Comments (11)
Going the asm.js route or just need to know if it's faster before porting 6.2?
I used the Emscripten compiled box2d.js and really did not like the interface. It's one of the reasons I switched to Chipmunk-js. I think it'll be a great thing to have but I hope it doesn't come at such a heavy cost. It's pretty nice not having to use getters and settings for everything. The other thing is will it really take care of GC given how the library is used....? Can't wait to find out :)
from chipmunk-js.
I want to know how much faster it is on firefox, how much slower on chrome and how much bigger it ends up. Especially if V8 ends up implementing the same optimizations, and especially because we have a great benchmarking library in ChipmunkJS.
Shame to hear that we'd need getters & setters for everything, though ChipmunkJS is currently a bit of a gross mixed bag at the moment anyway.
from chipmunk-js.
I tried it out. Its 2-3x as much code, but way faster. Chipmunk moves from taking ~8x the time in C to ~1.4x the time. (At least in that test, its only 40% slower)
http://chipmunk-physics.net/forum/viewtopic.php?f=1&t=2806&sid=164cfa132f3c828edf9cd0bc9ef0a39f
[Edit: sorry, 1.4x, not 1.7x]
from chipmunk-js.
Wow. Worth it!
j
On Sun, Jun 30, 2013 at 4:04 PM, Joseph Gentle [email protected]:
I tried it out. Its 2-3x as much code, but way faster. Chipmunk moves from
being ~8x slower than C to ~1.7x slower than C.http://chipmunk-physics.net/forum/viewtopic.php?f=1&t=2806&sid=164cfa132f3c828edf9cd0bc9ef0a39f
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-20242802
.
from chipmunk-js.
Agree. - Though I'm not sure what the best way to expose the API to JS is. In C, vectors live on the stack not the heap.
- I can change the API (eg,
setPos(x, y)
instead ofsetPos(myvect)
- although any function that returns a vector will be in trouble. - I could keep using a JS implementation of vectors for API methods, and then have wrapper functions which rewrite vectors to their native equivalents for chipmunk.
- I could put vectors in the emscripten heap and pass them through to emscripten as pointers, although then they won't get garbage collected.
All options are bad. :/
from chipmunk-js.
@nornagon ping for opinion
from chipmunk-js.
I like option 2 best.
from chipmunk-js.
Impressive results - it's a shame to lose the nice OOP layer you've added on top - so perhaps there's a way to wrap it (although im sure it'd cost us some, there seems to be plenty of performance to spare (8x!) )
from chipmunk-js.
Yeah I agree. Once you have your space set up, way more work happen inside chipmunk than over the chipmunk <-> JS layer.
from chipmunk-js.
Hey @josephg have you worked on this at all recently? I am using chipmunk-js in a game engine, and am highly interested in a faster and more up-to-date js port of Chipmunk2D. Any news?
from chipmunk-js.
1: http://josephg.com/blog/chipmunkjs-and-emscripten
2: http://josephg.com/blog/chipmunk-in-asm-js
I was playing around with my own low level javascript-style language (since LLJS has very little love) but I haven't had time to work on it.
In short, no news, no updates. If you're keen to take a stab at it, be by guest.
from chipmunk-js.
Related Issues (20)
- Possible optimization: Array-based vectors HOT 4
- regarding Collision Callback HOT 4
- Does not pass google closure advanced mode HOT 4
- Implement segment collision detection HOT 2
- Probably wrong context in SpatialIndex.prototype.collideStatic HOT 4
- Typescript Type Definitions? HOT 4
- jerky player movement HOT 7
- Performance boost 10-16% HOT 2
- Bug in Node js HOT 2
- Could you add a Demo branch that can access via Github HOT 2
- Old engine (node 0.6.5)
- Cannot move static bodies.
- BBTree 'count' property overrides 'count' method
- RotaryLimitJoint.prototype.getImpulse is missing the 'joint' argument
- NoCollide collides. HOT 3
- Demo link off
- Cannot create a body
- Body.applyForce is mis-implemented as Body.applyImpulse
- Native JS Bindings for Chipmunk HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chipmunk-js.