Comment #2 on issue 3903 by [email protected]: Math.log10 is
unexpectedly slow
https://code.google.com/p/v8/issues/detail?id=3903
I created a similar micro-benchmark here: http://jsperf.com/math-log10
The take-aways for Chrome:
Math.log10 is only slightly slower than the polyfill (Math.log(x) /
Math.LN10). It is however a lot slower than the polyfill version that
multiplies with the 1/Math.LN10 rather than using division.
On Firefox Math.log10 also performs slightly worse than the polyfill.
Though they got strength reduction and loop-invariant code motion done
correctly.
Note that Math.log10 should be more precise than the polyfill, for example
for 1E300. In V8 we do not use a C++ implementation from stdlib, but
provide a Javascript port [0]. Given the higher precision, I think the
slight performance difference should be acceptable.
[0]
https://code.google.com/p/chromium/codesearch#chromium/src/v8/src/third_party/fdlibm/fdlibm.js&q=fdlibm&sq=package:chromium&l=823
--
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.