cocos2d / cocos2d-js-tests

cocos2d JavaScript test cases and games.
187 stars 222 forks source link

Add a set of JS-optimization tests: PerformanceVirtualMachineTest. #190

Closed kennyluck closed 11 years ago

kennyluck commented 11 years ago

These showcases are accompanied by two pull requests to cocos2d-html5: #1015 and #1016.

These tests are the extreme conditions when the above two patches work the best. I have a bunch of comments in the tests already so I'll refrain from talking too much. Feel free to ask me questions.

VirtualMachineTestMainScene is pretty similar to NodeChildrenMainScene. In fact, I think these two should be merged if I can find Ricardo.

I haven't tested these on JSB.

Test results will come later.

kennyluck commented 11 years ago

Some notes (although this might be too obvious...):

The test results are in the wiki. It seems that these optimizations don't have an effect on JavaScriptCore and Chakra. Also, in Firefox, improvement on A1/B1/C1 can't be observed. That's might be because Firefox don't do "deferred Canvas API" like Chrome does. This optimization on Firefox might manifest in a game as the update() would be heavier than that in PerformanceSpriteTest.