Comment #4 on issue 2513 by [email protected]: life benchmark slowness
http://code.google.com/p/v8/issues/detail?id=2513
Using '|0' doesn't solve the problem, it is basically the same as the one
involving '&': This time we call the runtime for bitwise or. :-P Using the
ternary to make the conversion explicit is the only efficient way of
converting a boolean into a number. Furthermore, I consider this the only
*clean* way of doing it, everything else relies on extremely ugly implicit
conversions, which I consider a mis-feature in each and every language
providing them. </rant> ;-)
BTW: What kind of code size are you talking about? JavaScript source code
size? '?1:0' doesn't look that bad. Regarding machine code size it is only
a handful of instructions, too.
--
--
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.