Comment #4 on issue 3903 by [email protected]: Math.log10 is unexpectedly
slow
https://code.google.com/p/v8/issues/detail?id=3903
Thanks for the fast response. I think it would be interesting to see how a
JS port of fdlibm's log compared, and it might rule out function overhead
vs. VM translation.
I retested on:
OS X 10.10.2
i7 4870HQ (Haswell)
Chrome 40.0.2214.111 (64-bit) [note: not 41.x]
Firefox 35.0.1
Safari 8.0.3
http://jsperf.com/math-log10:
Chrome: polyfill: 3422
Chrome: Math.log10: 3003 [v40 approximation polyfill]
Chrome: Inline: 3495
Chrome: licm: 4402
Chrome: inverse: 4213
Safari: polyfill: 5946
Safari: Math.log10: 6050
Safari: inline: 6140
Safari: licm: 6917
Safari: inverse: 6803
Firefox: polyfill: 7042
Firefox: Math.log10: 7649
Firefox: inline: 7125
Firefox: licm: 7600
Firefox: inverse: 7416
Previously attached test case:
Chrome: log/fmul: 3940 ms
Chrome: log10: 4683 ms
Safari: log/fmul: 3328 ms
Safari: log10: 3111 ms
Firefox: log/fmul: 2695 ms
Firefox: log10: 2500 ms
For both tests, per-browser results were opposite of what I expected.
Chrome's performance on OS X seemed off for these test runs, maybe a
problem with my local install/config. Might be worth further investigation
if that can be replicated on another OS X / Haswell platform.
Safari's implementation seems to be:
https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/runtime/MathObject.cpp#L117
putDirectNativeFunctionWithoutTransition(vm, globalObject,
Identifier(&vm, "log10"), 1, mathProtoFuncLog10, NoIntrinsic, DontEnum |
Function);
So like Firefox/SpiderMonkey, reduced function overhead. Again, be
interesting to see a comparison to V8 with that negated.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
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/d/optout.