Live data from Hacker News

Box2d Revisited

j15r.com

21–30 of 44 posts

Re: Box2d Revisited

#21

I'd love to see the numbers for the asm.js version running in Safari and Chrome

You can grab his repo and try it yourself, but as I commented on the blogpost, on my machine I see firefox without asm.js optimizations and chrome as being about the same speed, both of them are half the speed of firefox with asm.js optimizations. (I don't have a machine with safari to test on.)

Which means the asm.js version is faster than other JS versions, even without specific asm.js optimizations.

Re: Box2d Revisited

#22

Not too useful as does not include one of the very popular ports and an additional major platform: http://farseerphysics.codeplex.com/ :(

It's perfectly useful as comparison of browser-based Box2d ports, and how they perform relative to the original C library.

Re: Box2d Revisited

#23

Not too useful as does not include one of the very popular ports and an additional major platform: http://farseerphysics.codeplex.com/ :(

It's perfectly useful as comparison of browser-based Box2d ports, and how they perform relative to the original C library.

Re: Box2d Revisited

#25
post #19
post #10

Earlier quoted context omitted.

To answer my own question, I got: gcc 4.6.3: 3.554688 +/- 4.786550 clang trunk: 3.593750 +/- 4.798172 Chrome: 41.03515625 +/- 9.331709130062185 Which puts Chrome at about 11x these native compilers, consistent with the blog post.

gcc 4.8.0: 1.640625 +/- 3.703323 clang 3.2: 1.718750 +/- 3.772718 chrome : 23.28515625 +/- 3.636932727324763 So chrome is about ~14x the native compilers. Changing gcc to use -O2 instead of -O3 gets: 1.562500 +/- 3.630922.

What about -Ofast which enables -ffast-math?

Re: Box2d Revisited

#26
post #24

Interesting that NaCl is far closer to native performance than asm.js. Can that performance gap be closed?

I'm not sure I'd call that "far" different, but asm.js is certainly in early stages so it probably will get faster.

Re: Box2d Revisited

#27
post #24

Interesting that NaCl is far closer to native performance than asm.js. Can that performance gap be closed?

I'm not sure I'd call that "far" different, but asm.js is certainly in early stages so it probably will get faster.

    C (gcc 4.2.1)	2.62 +/- 0.24	1.0x
    NaCl (x86-32)	3.39 +/- 0.25	1.3x
    asm.js (Firefox Nightly)	5.12 +/- 0.59	1.9x
NaCl is 30% slower, asm.js is 90% slower.

Re: Box2d Revisited

#28
post #27

Earlier quoted context omitted.

I'm not sure I'd call that "far" different, but asm.js is certainly in early stages so it probably will get faster.

C (gcc 4.2.1) 2.62 +/- 0.24 1.0x NaCl (x86-32) 3.39 +/- 0.25 1.3x asm.js (Firefox Nightly) 5.12 +/- 0.59 1.9x NaCl is 30% slower, asm.js is 90% slower.

Your conclusion doesn't follow from your data. 5.12 is not 90% slower than 2.62, it's 51% slower.

Re: Box2d Revisited

#29
Well, I'm very impressed with the asm.js numbers - its lead over the JVM is really unexpected (to me, at least). I've not been a JS fan, but if asm.js can pull out this kind of performance at this early stage then perhaps this really could work as an 'bytecode for the web'. That would be nice because it would allow a common compilation target for people to output to from whatever their favourite language - which is clearly a better situation that 'whatever language you like so long as it's JavaScript' :o)
Post reply on HN