Slower than JSC at calling `Date.now = () => +new Date('2023-05-12T08:35:00');`
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
People
(Reporter: mstange, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: perf, Whiteboard: [sp3])
Attachments
(1 file)
|
585 bytes,
text/html
|
Details |
On the Perf-Dashboard subtest of sp3, Date.now has been stubbed out as follows:
Date.now = () => +new Date('2023-05-12T08:35:00');
On the attached microbenchmark, I get 435ms in Firefox and 231ms in Safari Technology Preview 227, i.e. Safari being 1.9x faster.
Doubling our speed here may give us a 1% win on the Perf-Dashboard subtest.
See bug 2026748 comment 4 for more context.
Updated•2 months ago
|
Comment 1•2 months ago
|
||
In the linked comment I mention two possible approaches for speeding this up: a one-element cache when parsing Dates, and CacheIR support for converting Dates to number. I got Claude to prototype the second approach; it brings us within ~15% of jsc. If we also do the one-element cache, I think we should be significantly faster.
Updated•2 months ago
|
Comment 2•1 month ago
|
||
Should this bug get the "PERF" key word? I can do it if someone can fix that for me. Thank you.
| Reporter | ||
Comment 3•1 month ago
|
||
This looks well and truly fixed now. Thanks anba and Iain!
I now get 64ms in Firefox, down from 435ms and way lower than Safari's ~200ms.
Description
•