Comment #2 on issue 2513 by [email protected]: life benchmark slowness
http://code.google.com/p/v8/issues/detail?id=2513

The reason for the bad performance is that in the code generated by Emscripten boolean values are used as integers, e.g. in expressions like 'i7 & (i2 | 0) > 0'. We basically fall back to a generic runtime function to perform the bitwise AND (including the implicit conversion). Mechanically replacing all such expressions by an equivalent ternary, e.g. 'i7 & ((i2 | 0) > 0 ? 1 : 0)' for the expression above, reduces the time for the benchmark by a factor of 4, see attached diff.

Perhaps we can generate better code for such expressions, but doing it in a way that doesn't hurt "good" JavaScript code is a bit tricky, so this won't happen soon. Therefore, it would be nice if Emscripten could be changed to generate the boolean->int conversion explicitly.

Attachments:
        life.diff  856 bytes

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to