RESOLVED FIXED Bug 38714
Add result caching for Math.sin
https://bugs.webkit.org/show_bug.cgi?id=38714
Summary Add result caching for Math.sin
Gavin Barraclough
Reported 2010-05-06 20:28:40 PDT
Math.sin is frequently called with the same operand, caching the result should improve performance.
Attachments
The patch (10.03 KB, patch)
2010-05-06 20:34 PDT, Gavin Barraclough
ggaren: review+
Gavin Barraclough
Comment 1 2010-05-06 20:34:13 PDT
Created attachment 55335 [details] The patch 2% - 2.5% progression on SunSpider.
Geoffrey Garen
Comment 2 2010-05-06 20:43:37 PDT
Comment on attachment 55335 [details] The patch r=me
Zoltan Herczeg
Comment 3 2010-05-06 20:51:18 PDT
Perhaps it would be worth to tell in the ChangeLog why do you choose this hash function, how do you prove this is effective, why the cache size is 4096. In short, some explanation about the algorithm.
Gavin Barraclough
Comment 4 2010-05-06 21:48:24 PDT
Hey Zoltan, will do, but the simple answer is this: there hasn't been a huge amount of thought go into this hash function. :-) I deliberately picked something with the following properties: * very cheap to calculate since we can't cache the hash value, * something which we can easily implement in asm, so that we can do so in an thunk if we wish, * something that tried to preserve as many bits from the float value as possible, without increasing the number of calculations. The hash as implemented seems to work well enough, and I thought that by committing I get the code out in the public where others can improve on it too. :-)
Gavin Barraclough
Comment 5 2010-05-06 22:03:41 PDT
Transmitting file data ...... Committed revision 58935.
Note You need to log in before you can comment on or make changes to this bug.