Bug 4325 - Mozilla Date tests have an unnecessary loop that runs 1970 times before each test
Summary: Mozilla Date tests have an unnecessary loop that runs 1970 times before each ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P3 Enhancement
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-07 18:25 PDT by Darin Adler
Modified: 2005-08-08 10:29 PDT (History)
0 users

See Also:


Attachments
patch to use "year 0" constant instead of computing it each time (52.74 KB, patch)
2005-08-07 18:26 PDT, Darin Adler
sullivan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2005-08-07 18:25:58 PDT
There's code to compute the value of "year 0" in all the Mozilla date tests. There's no need to compute this 
on entry to each test.

This is not all of why the tests are slow, but it's at least part of it.
Comment 1 Darin Adler 2005-08-07 18:26:59 PDT
Created attachment 3271 [details]
patch to use "year 0" constant instead of computing it each time
Comment 2 John Sullivan 2005-08-08 09:08:55 PDT
Comment on attachment 3271 [details]
patch to use "year 0" constant instead of computing it each time

looks good
Comment 3 Geoffrey Garen 2005-08-08 10:29:07 PDT
I'm pretty sure the rest of the slowness can be corrected by similar fixes -- turning repeated calculations 
into constants. The date tests are pretty pedantic in how they calculate correct answers.