Status: New
Owner: ----
New issue 2631 by davidgal...@turbulenz.biz: Integer values stored on a
Float32Array severely impact performance when read
http://code.google.com/p/v8/issues/detail?id=2631
The two attached micro-benchmarks differ only in the values stored on the
Float32Arrays. The file "identity.js" fills the arrays with 1.0 and 0.0,
whilst the file "almostidentity.js" fills the arrays with 1.001 and 0.001.
Both files print 3 numbers (usually the same value), each will be the
median time it takes to execute the test several times, the lower the value
the better.
I was assuming both files should generate the same timing values, but they
don't. The file "almostidentity.js" is almost twice faster
than "identity.js", which makes no sense to me, why does it matter which
values I store on a Float32Array?
The only explanation I can think of is that V8 detects that the values
coming from the Float32Array are integers, generates code to do the
calculations using integers, but then the values have to be converted back
to floating point when writing back to the Float32Array, but this is a wild
guess.
The benchmark code runs fine on d8, but it is easy to modify to execute on
a browser, both should produce equivalent disparate results between the two
files.
I test with a version of d8 using V8 version 3.17.16 (candidate), and a
modified version of the files to work on the browser was tested with Chrome
26 and 28 canary, with similar differences in performance to the d8 version.
Attachments:
identity.js 3.5 KB
almostidentity.js 3.5 KB
--
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
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.