Closed
Bug 601821
Opened 14 years ago
Closed 10 years ago
Make Date.getYear and others even faster
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: dmandelin, Assigned: jandem)
References
Details
(Keywords: perf)
Attachments
(1 file)
18.75 KB,
patch
|
Details | Diff | Splinter Review |
Bug 578259 made a lot of progress on here by caching the values for hours, minutes, seconds, etc. on the first call. (I note that JSC has the same optimization.) But we still 2x slower on the benchmark given below. This seems to account for a little under half the gap on date-format-xparb, or maybe 3ms on AWFY.
var date = new Date("1/1/2007 1:11:11");
var t0 = new Date;
for (i = 0; i < 400000; ++i) {
date.getYear();
date.setTime(date.getTime() + 84266956);
}
print(new Date - t0);
Comment 1•14 years ago
|
||
Does the latest patch in bug 584917 help?
/be
Assignee | ||
Comment 2•14 years ago
|
||
The problem here is that the test case in comment 0 generates dates with years > 2038. That hits a slow path in the date code.
I have a fix for this and some other jsdate issues. The patch passes jstests and trace-tests. For the benchmark in comment 0:
- before: 380 ms
- after: 186 ms
- V8: 167 ms
SS improves a bit, but not much; maybe 1-2 ms if we are lucky.
The algorithm is based on V8 and I copied some static int array's from their code. What steps do I need to take to prevent licensing trouble? Do we need to mention them in the jsdate.cpp header?
Assignee | ||
Comment 3•14 years ago
|
||
Down to 157 ms with this patch; 10 ms faster than V8. TODO: credit V8 authors; fix style issues, will fix that tomorrow or next week.
Assignee: general → jandemooij
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•14 years ago
|
||
This helps the micro-benchmark but does not help format-{xparb,tofte} at all. Afaik most of the date functions used by date-format-xparb are cached and quite fast, the biggest problem seems to be string concatenation and "new String(arg)" performance. I will stop working on this for now as there are still more important issues.
Comment 5•11 years ago
|
||
On Windows 7
Nightly 32.0a1 (2014-05-06) - 747ms
Chrome 34 - 164ms
Comment 6•11 years ago
|
||
* Jan: is there any value in landing your WIP patch from 2010? Or should we just close this bug as WONTFIX?
On my MacBook Pro, the test case from comment 0 is just as fast in Firefox and Chrome. Actually, Firefox performance might have regressed since Firefox 29:
* Firefox 29: ~390 ms
* Beta 30: ~390 ms
* Aurora 31: ~440 ms
* Nightly 32: ~450 ms
* Chrome 34: ~450 ms
Flags: needinfo?(jdemooij)
Keywords: perf
Assignee | ||
Comment 7•11 years ago
|
||
Comment 8•11 years ago
|
||
Considering that he probably has a faster machine than I, it seems that it's a Chrome problem on Mac.
Assignee | ||
Comment 9•10 years ago
|
||
Closing as WONTFIX; this doesn't seem relevant anymore.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(jdemooij)
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•