Jump to content

Measuring performace of javascript?


ZippoLag
 Share

Recommended Posts

So.. I'm looking into physics engines and the most promising one I can find is box2d. Problem: there are several implementations floating around, the most prominent ones being box2dweb and box2djs, both ported from an actionscript (flash) port, and box2d.js wich is ported to javascript directly from the c++ source using emscripten. Now, given how the first two have that translation to actionscript in between and are not as freshly updated as the last one, my gut tells me box2d.js should be the better performing one, but that's not enough: I want numbers!

 

Additionally, I'd like to arrive to conclusions of the sort of "how many box2d worlds of this game of mine can I run concurrently on my node.js server before performance goes to hell?", "what's the highest simulation precision I can run on this particular mobile phone before fps drops below 30?" and the such.

 

The thing is: I've never done this kind of testing before and have no idea where to start. Help?

Link to comment
Share on other sites

At least for frontend testing, you can rely on the http://jsperf.com/ service.

They automatically store the results of all test cases you create, so you only need to send your URL around and let people run the tests on all kinds of different machines with different browsers.

 

Here is a example I made recently to test the different versions of the drawImage() canvas method and which one is the best performing: http://jsperf.com/drawimage-tests

Just scroll down a bit to the table with the test and hit the "run tests" button. Thats it.

You get a nice graph at the end, showing your results in comparsion to other browsers.

 

 

For testing the node.js side there are surely also some tools around but I don't have much experience there, sorry.

Link to comment
Share on other sites

At least for frontend testing, you can rely on the http://jsperf.com/ service.

They automatically store the results of all test cases you create, so you only need to send your URL around and let people run the tests on all kinds of different machines with different browsers.

 

Here is a example I made recently to test the different versions of the drawImage() canvas method and which one is the best performing: http://jsperf.com/drawimage-tests

Just scroll down a bit to the table with the test and hit the "run tests" button. Thats it.

You get a nice graph at the end, showing your results in comparsion to other browsers.

 

 

For testing the node.js side there are surely also some tools around but I don't have much experience there, sorry.

Thans! I'll keep that one at hand :D

In regards to comparing different box2d ports and on different browsers, the guys over at the box2d forum kindly pointed me to these posts:

http://blog.j15r.com/blog/2011/12/15/Box2D_as_a_Measure_of_Runtime_Performance

http://blog.j15r.com/blog/2013/04/25/Box2d_Revisited

 

Also don't limit yourself to box2d - cannon.js is pretty neat.

 

Just found canno.js is a 3d physics engine, will it perform better or worse for 2d games? Is there any other 2d physics engines which has less feature but runs faster?

 

I had that one and bullet on sight as well, but indeed they are 3d engines and I'm more than done with contemplating 2d for now. Thanks all the same ^^

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...