[Pkg] The Trunk: Kernel-cmm.607.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Aug 16 02:49:14 UTC 2011
Chris Muller uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-cmm.607.mcz
==================== Summary ====================
Name: Kernel-cmm.607
Author: cmm
Time: 17 July 2011, 3:19:27.832 pm
UUID: 707fff1e-e5d5-46e9-9c87-75010916820b
Ancestors: Kernel-nice.605
- Size and speed optimization for DateAndTime, Date, and other Timespans. By sending them the new #makeUTC message, Dates can now share a canonicalized #zero 'offset' Duration. Hashing Dates created in offset zero is many times faster than those with other offsets.
- Since there are typically many Dates in the system, their 1-day 'duration' is also shared.
=============== Diff against Kernel-nice.605 ===============
Item was changed:
SharedPool subclass: #ChronologyConstants
instanceVariableNames: 'seconds offset jdn nanos'
+ classVariableNames: 'DayNames DaysInMonth MonthNames NanosInMillisecond NanosInSecond OneDay SecondsInDay SecondsInHour SecondsInMinute SqueakEpoch Zero'
- classVariableNames: 'DayNames DaysInMonth MonthNames NanosInMillisecond NanosInSecond SecondsInDay SecondsInHour SecondsInMinute SqueakEpoch'
poolDictionaries: ''
category: 'Kernel-Chronology'!
!ChronologyConstants commentStamp: 'brp 3/12/2004 14:34' prior: 0!
ChronologyConstants is a SharedPool for the constants used by the Kernel-Chronology classes.!
Item was changed:
----- Method: Date class>>starting: (in category 'squeak protocol') -----
+ starting: aDateAndTime
+ ^ super
+ starting: aDateAndTime midnight
+ duration: Duration oneDay!
- starting: aDateAndTime
-
- ^super starting: (aDateAndTime midnight) duration: (Duration days: 1)!
Item was added:
+ ----- Method: DateAndTime>>makeUTC (in category 'squeak protocol') -----
+ makeUTC
+ "Change the receiver's timezone to UTC. Like #asUTC, but modifies the receiver and is much faster."
+ self primOffset: Duration zero!
Item was added:
+ ----- Method: DateAndTime>>primOffset: (in category 'private') -----
+ primOffset: aDuration
+ offset := aDuration!
Item was added:
+ ----- Method: Duration class>>initialize (in category 'initialize-release') -----
+ initialize
+ ChronologyConstants classPool
+ at: #Zero
+ put:
+ (self basicNew
+ seconds: 0
+ nanoSeconds: 0) ;
+ at: #OneDay
+ put: 1 day!
Item was added:
+ ----- Method: Duration class>>oneDay (in category 'squeak protocol') -----
+ oneDay
+ "Answer the canonicalized Duration representing length of 1 day. Used by Dates."
+ ^ OneDay!
Item was changed:
----- Method: Duration class>>zero (in category 'ansi protocol') -----
zero
+ "Answer the canonicalized instance of Duration zero."
+ ^ Zero!
-
- ^ self basicNew seconds: 0 nanoSeconds: 0
- !
Item was added:
+ ----- Method: Timespan>>makeUTC (in category 'squeak protocol') -----
+ makeUTC
+ "Change the receiver's timezone to UTC, which affords substantially better hashing performance."
+ start makeUTC!
More information about the Packages
mailing list