News for hackers. Stuff that matters.
Re:Box2d Revisited by niggler on Thursday April 25, 2013 @11:12PM (#5611289)
Interesting that NaCl is far closer to native performance than asm.js. Can that performance gap be closed?
Re:Box2d Revisited by jlongster on Thursday April 25, 2013 @11:16PM (#5611300)
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 by niggler on Thursday April 25, 2013 @11:38PM (#5611351)

    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 by lutusp on Thursday April 25, 2013 @11:44PM (#5611360)
Your conclusion doesn't follow from your data. 5.12 is not 90% slower than 2.62, it's 51% slower.
Re:Box2d Revisited by chr1 on Friday April 26, 2013 @02:09AM (#5611719)
He says NaCl is 30% slower than _c++_, asm.js is 90% slower than _c++_ which is correct.
Re:Box2d Revisited by lutusp on Friday April 26, 2013 @05:45AM (#5612152)
For asm.js to be 90% slower than c++, it would have to run at 10% the speed of c++, not 51% of its speed, which is what the data shows. 100% slower is not 1/2 the speed, it's no speed at all.

Take some speed x. Increasing it by 100% gives 2x. Decreasing it by 100% gives zero.

Expressed another way, 100% of x is x. Add 100% = 2x, Subtract 100% = zero. The original claim is "90% slower." Clearly the OP either meant 51% slower or 49% slower, depending on how one reads it.

a = 2.62

b = 5.19

a / b = 0.5048, or 50.48%: "b has 50.48 percent the speed of a".

EDIT: wow, once again downvoted for being right and proving it.

Re:Box2d Revisited by jules on Friday April 26, 2013 @06:13AM (#5612211)
English conventions are inconsistent. "X is 2x slower than Y" usually means that Y runs at twice the speed of X. Since 90% = 0.9, "X is 90% slower than Y" would mean that X is actually faster than Y. Therefore it's better to state it in an unambiguous way, e.g. X took 2x as much time as Y, or just look at the numbers directly.
Re:Box2d Revisited by lutusp on Friday April 26, 2013 @06:36AM (#5612250)
> English conventions are inconsistent.

Yes, and it's an argument for expressing these ideas with mathematics instead of words.

> Therefore it's better to state it in an unambiguous way, e.g. X took 2x as much time as Y, or just look at the numbers directly.

Complete agreement.