ZhouWeikuan / cocos2d

cocos2d for android, based on cocos2d-android-0.82, and now ported from cocos2d-iphone 0.99.4. The googlecode address is here: http://code.google.com/p/cocos2d-android-1/ . There are several demos to watch.
610 stars 291 forks source link

DalvikVM FloatBuffer.put() bug fix. #13

Closed dustinanon closed 13 years ago

dustinanon commented 13 years ago

There is a bug in which Android's implementation of FloatBuffer.put() is very, very expensive. The performance issues are documented in this thread:

http://www.java-gaming.org/index.php?topic=22541.0

In that thread, Ryan McNally (ryanm) proposes a drop in replacement which wraps the methods of FloatBuffer. I extended that (couldn't find a source project) for the use cases I found in the cocos2d project. The result is that everything is much faster and smoother.

After 2.3 is commonplace it should be okay to remove the FastFloatBuffer class, but as for my company, we work on Android 2.2 and the bug was cripplingly slow.