Bug 16583

Summary: Speedup date code (msToGregorianDateTime) by only handling positive values
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: barraclough
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.4   

Description Eric Seidel (no email) 2007-12-23 01:52:28 PST
Speedup date code (msToGregorianDateTime) by only handling positive values

msToGregorianDateTime and the associated static inline support functions are slow due to needing to handle negative values for ms.  Instead we should detect that ms is negative, flip the sign, send it through normal processing and then flip the signs on the resulting GregorianDateTime.  This would add a branch, but would greatly speed up date processing due to the removal of all of the floor() calls.
Comment 1 Gavin Barraclough 2012-09-07 12:35:48 PDT
flipping the sign would not in itself allow us to remove calls to floor.  Our date math has changed a lot in the last 4 years, I don't think this bug is still tracking active optimization effort.