I'm writting a 2d math library: js-2dmath to do a real test, I choose to rewrite some of your code (cpVec2 atm) and use mine. The speed boost was so good... I'm really happy but...
There is a problem, js-2dmath use arrays and Chipmunk-js objects/prototypes.
So before PR and cleanup are you really interested ? it's a hard change.
Another possibility is to use falafel to rewrite the code, dont know if it's really possible...
These are my numbers
Firefox (10%)
normal: "time to beat: " 18642.66666666667
js-2dmath: "time to beat: " 16883.666666666668
Chrome (16%)
normal: time to beat: 42554
js-2dmath: time to beat: 36557.66666666667
Test my fork with
git clone https://github.com/llafuente/Chipmunk-js
cd Chipmunk-js && npm install
firefox benchmark/bench.html
Hi,
I'm writting a 2d math library: js-2dmath to do a real test, I choose to rewrite some of your code (cpVec2 atm) and use mine. The speed boost was so good... I'm really happy but...
There is a problem, js-2dmath use arrays and Chipmunk-js objects/prototypes. So before PR and cleanup are you really interested ? it's a hard change.
Another possibility is to use falafel to rewrite the code, dont know if it's really possible...
These are my numbers
Firefox (10%)
Chrome (16%)
Test my fork with