josephg / Chipmunk-js

Port of slembcke/Chipmunk-Physics to Javascript
http://dl.dropbox.com/u/2494815/demo/Joints.html
537 stars 59 forks source link

Performance boost 10-16% #28

Closed llafuente closed 8 years ago

llafuente commented 10 years ago

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

git clone https://github.com/llafuente/Chipmunk-js
cd Chipmunk-js && npm install
firefox benchmark/bench.html
josephg commented 8 years ago

Oh sorry I totally missed this. I haven't touched chipmunkjs in years.

josephg commented 8 years ago

Nice performance jump! Wonder if it still holds