Closed Bug 849785 Opened 11 years ago Closed 11 years ago

DST regressed sunspider date tests

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22
blocking-b2g tef+
Tracking Status
firefox19 --- unaffected
firefox20 --- unaffected
firefox21 + fixed
firefox22 + fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- fixed

People

(Reporter: jandem, Assigned: bhackett1024)

References

Details

Attachments

(2 files)

Our SS score on AWFY regressed by 7% over the weekend, due to DST in the US and Canada. date-format-xparb is responsible for most of the slowdown, but also a small date-format-tofte regression.

For the micro-benchmark below I get:

- Without DST:  293 ms
- with DST:    1221 ms

I tracked it down to UTCToLocalStandardOffsetSeconds, there's an extra mktime call with DST:

    currentNoDST = mktime(&local);

Jeff, is this a regression from bug 830257? I hope so because it means beta and release are not affected. Can you take a look?

----

var t = new Date;
var date = new Date("1/1/2007 1:11:11");
for (i = 0; i < 400000; ++i) {
    date.getFullYear();
    date.setTime(date.getTime() + 84266956);
}
print(new Date - t);
(In reply to Jan de Mooij [:jandem] from comment #0)
> Jeff, is this a regression from bug 830257? I hope so because it means beta
> and release are not affected.

I can't reproduce on mozilla-beta.
Probably yeah, a regression from that.

Given the way the DST cache works, there's a chance this delta will go away in a month or so.  It would be interesting for someone to test with system time adjusted to May or so to see if the problem shows up then.
Attached patch patchSplinter Review
This patch fixes the regression for me.  The function with the mktime (which is known from bug 578259 to be horrifically slow on at least some platforms) is explicitly computing the difference vs. UTC without any DST effects, so its result will always be the same within a given time zone.  The patch just caches this difference, and refreshes it at the same time as the time zone adjustment.
Attachment #723697 - Flags: review?(jwalden+bmo)
Comment on attachment 723697 [details] [diff] [review]
patch

Review of attachment 723697 [details] [diff] [review]:
-----------------------------------------------------------------

Excellent.
Attachment #723697 - Flags: review?(jwalden+bmo) → review+
Assignee: general → bhackett1024
Comment on attachment 723697 [details] [diff] [review]
patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 830257
User impact if declined: worse sunspider score
Testing completed (on m-c, etc.): on trunk
Risk to taking this patch (and alternatives if risky): low
Attachment #723697 - Flags: approval-mozilla-b2g18?
Attachment #723697 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/8948998650e1
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Attachment #723697 - Flags: approval-mozilla-b2g18?
Attachment #723697 - Flags: approval-mozilla-b2g18+
Attachment #723697 - Flags: approval-mozilla-aurora?
Attachment #723697 - Flags: approval-mozilla-aurora+
This is going to need some love to land on b2g18.
Attached patch b2g patchSplinter Review
This is different enough to need a re-review.
Attachment #725360 - Flags: review?(jwalden+bmo)
Attachment #725360 - Flags: review?(jwalden+bmo) → review+
should this land on b2g 1.0.1 too ?
According to Bug 830257 comment 47 we should uplift this to v1.0.1 too.
blocking-b2g: --- → tef?
blocking-b2g: tef? → tef+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: