Bug 15852

Summary: date-format-xparb spends 12% of TOTAL TIME in localtime_r
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: barraclough, darin, emacemac7, kmccullough
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
here's the old date patch I had lying around -- not sure how good it is
none
Updated version of darin's date patch (broken, I think)
none
darin's patch, updated for TOT (0.5% slower on SunSpider) none

Description Eric Seidel (no email) 2007-11-06 01:28:57 PST
date-format-xparb spends 12% of TOTAL TIME in localtime_r

Holy broken date code, batman!

Darin mentioned that he had a rewrite of some of the date code sitting in a patch on his machine at one point in time.  Perhaps that also included a fix for this.

I'm sure there is a simpler (& faster) way to do getDSTOffset()
Comment 1 Darin Adler 2007-11-06 08:47:13 PST
Created attachment 17060 [details]
here's the old date patch I had lying around -- not sure how good it is
Comment 2 Eric Seidel (no email) 2007-11-06 12:07:12 PST
Created attachment 17063 [details]
Updated version of darin's date patch (broken, I think)

I think the patch somehow broke (hangs) after updating it to TOT.  I've not investigated yet.
Comment 3 Eric Seidel (no email) 2007-11-06 12:19:56 PST
Created attachment 17064 [details]
darin's patch, updated for TOT (0.5% slower on SunSpider)
Comment 4 Eric Seidel (no email) 2007-11-19 06:05:57 PST
localtime_r has made it's way all the way to .6% of *total time*.  KJS::getDSTOffset(double) is 1.1% of total time on my machine.
Comment 5 Eric Seidel (no email) 2007-11-19 06:06:17 PST
Those numbers are for a --shark20 sample across all tests.
Comment 6 Alexey Proskuryakov 2009-03-24 10:57:05 PDT
Eric, is this bug still valid?
Comment 7 Eric Seidel (no email) 2009-03-24 11:30:58 PDT
Unless someone has re-written the date code, we are likely still spending too much time here, yes.
Comment 8 Gavin Barraclough 2012-09-06 16:37:36 PDT
The date code has been rewritten;  date-format-xparb does not call localtime_r.