@gaofei_dev 写道:
用profiler分析发现 CCGame.js
//Run game.
_runMainLoop: function () {
var self = this, callback, config = self.config, CONFIG_KEY = self.CONFIG_KEY,
director = cc.director;director.setDisplayStats(config[CONFIG_KEY.showFPS]); callback = function () { if (!self._paused) { director.mainLoop(); if(self._intervalId) window.cancelAnimationFrame(self._intervalId); self._intervalId = window.requestAnimFrame(callback); } }; window.requestAnimFrame(callback); self._paused = false; },
//////////////////////////////////////
window.requestAnimFrame(callback); 这行的开销占据了95%以上,有何优化办法?
帖子: 1
参与者: 1