About ccClass Release Mode¶
But in order to mimic C style OOP pattern, there need to be a way to access parent version of a function. this._super() achieves this, but with some sacrifice in performance.
What we did is rewrite the functions that uses this._super() at run time to directly points to the parent's function. think it as a mini JIT compiler!
The result is at least 10% increase in performance, the down side is that it is now impossible to set break point inside functions that has this._super(), as that function was rewritten in run time!
So we added a flag that you can toggle this optimization on and off.
We call it release mode as it is recommended for release build only.
to turn it on, simply add the "CLASS_RELEASE_MODE:true" config to cocos2d.js