Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004669 [Squeak] Kernel minor always 08-31-06 02:22 12-01-08 23:36
Reporter gokr View Status public  
Assigned To
Priority normal Resolution fixed  
Status closed   Product Version 3.8
Summary 0004669: [ENH] TimeForSpeed
Description Ok, so we were trying to figure out why our logger in Gjallar spent so much time in creating DateAndTime etc... after looking, tweaking, profiling and even some thinking I came up with this "SpeedPack" of changes.

I might have broken some subtleties (I don't think I have though) but the tests are still green. Glad for any indepth review.

And? Well, the speed differences are quite huge. :) Lots of it comes from better Duration instance creation methods and from not going back and forth too much between nanos and seconds etc.

"DateAndTime now" is about 6 times faster and "Date today" 4 times. The full chronology test suite runs almost 2 times faster. See preamble for a do-it that shows this (run before and after installing cs).

So far only tested in 3.8.
Additional Information
Attached Files  TimeForSpeed-gk.1.cs.gz [^] (2,734 bytes) 08-31-06 02:22
 fasterDayOfYear-brp.1.cs.gz [^] (825 bytes) 08-31-06 14:06
 before.png [^] (10,202 bytes) 11-23-07 10:04
 after.png [^] (10,325 bytes) 11-23-07 10:05

- Relationships

SYSTEM WARNING: Creating default object from empty value

related to 0000474closed KenCausey [BUG][FIX] accurateDateAndTimeNow-brp 
related to 0007356closed lewis DateAndTime fromSeconds: 0.5 => walkback, broken since Mantis 4669 

- Notes
(0006827 - 697 - 896 - 896 - 896 - 896 - 896)
brp
08-31-06 14:06

I am nominally responsible for the Chronology package since I wrote it :)

I have tested and reviewed this change. All tests pass in 3.8.1 (6744).

I would also encourage this enhancement to include Dan Ingall's modificaton
which significantly speeds up printing a DateAndTime instance. All tests work with both enhancements. I have attached my cleanup of Dan's code to this issue.

    suite := TestSuite new name: 'Chronology Tests'.
    (SystemOrganization superclassOrder: #'Kernel-Chronology-Tests')
        do: [ :tc | tc addToSuiteFromSelectors: suite ].
    suite run.

420 run, 420 passes, 0 expected failures, 0 failures, 0 errors...

I strongly encourage both changesets to be approved.
 
(0011451 - 986 - 1291 - 1291 - 1291 - 1291 - 1291)
edgardec
11-23-07 10:04
edited on: 11-23-07 10:06

Tested in Squeak3.10.1beta.7155.image .
In a workspace I put this slight changed test from Goran, press tallyIt.

| suite |
Smalltalk garbageCollect.
result _ {
    [10000 timesRepeat: [Date today]] timeToRun.
    [10000 timesRepeat: [DateAndTime now]] timeToRun.
    [10000 timesRepeat: [DateAndTime year: 2000 day: 120]] timeToRun.
    [10000 timesRepeat: [Duration weeks: 1]] timeToRun.
    [10000 timesRepeat: [Duration milliSeconds: 1]] timeToRun.
    [10000 timesRepeat: [(Duration seconds: 10 nanoSeconds: 1) ticks]] timeToRun.
} asOrderedCollection.
suite _ TestSuite new name: 'Chronology tests'.
(SystemOrganization superclassOrder: #'KernelTests-Chronology') remove: StopwatchTest;
    do: [:c | c addToSuiteFromSelectors: suite ].
suite tests remove: (suite tests detect: [:e | e selector = #testMonotonicity ]).
result add: [10 timesRepeat: [suite run]] timeToRun.
result


I put the picts here. 3 to one speedUp is very good
Doing 7156 update for 3.10. Thanks people !

 
(0012824 - 53 - 53 - 53 - 53 - 53 - 53)
KenCausey
12-01-08 23:36

Harvested as update 7156 and released in Squeak 3.10.
 

- Issue History
Date Modified Username Field Change
08-31-06 02:22 gokr New Issue
08-31-06 02:22 gokr File Added: TimeForSpeed-gk.1.cs.gz
08-31-06 13:58 brp Issue Monitored: brp
08-31-06 14:06 brp Note Added: 0006827
08-31-06 14:06 brp File Added: fasterDayOfYear-brp.1.cs.gz
10-13-06 13:42 MarcusDenker Relationship added related to 0000474
11-23-07 10:04 edgardec Note Added: 0011451
11-23-07 10:04 edgardec File Added: before.png
11-23-07 10:05 edgardec File Added: after.png
11-23-07 10:06 edgardec Note Edited: 0011451
12-01-08 23:36 KenCausey Status new => closed
12-01-08 23:36 KenCausey Note Added: 0012824
12-01-08 23:36 KenCausey Resolution open => fixed
12-01-08 23:36 KenCausey Fixed in Version  => 3.10
01-08-09 02:46 lewis Issue Monitored: lewis
06-26-09 02:54 lewis Relationship added related to 0007356


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
71 total queries executed.
42 unique queries executed.
Powered by Mantis Bugtracker