[squeak-dev] The Trunk: Kernel-nice.686.mcz

commits at source.squeak.org commits at source.squeak.org
Fri May 11 20:50:33 UTC 2012


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.686.mcz

==================== Summary ====================

Name: Kernel-nice.686
Author: nice
Time: 11 May 2012, 10:49:19.244 pm
UUID: f59cead1-1757-4e97-9ffc-19fa5a8dd384
Ancestors: Kernel-nice.685

Improve DateAndTime hash speed by ~2 order of magnitude with a collision rate of ~1 per 10,000, following suggestion of pad, reviewed by nice.

Care to HashedCollection rehashAll in postscript.

=============== Diff against Kernel-nice.685 ===============

Item was changed:
  ----- Method: DateAndTime>>hash (in category 'ansi protocol') -----
  hash
+ 	| totalSeconds |
+ 	totalSeconds := seconds - offset asSeconds.
+ 	^ ((totalSeconds // 86400 + jdn) hashMultiply bitXor: totalSeconds \\
+ 86400) bitXor: nanos!
- 
- 	^ self asUTC ticks hash!

Item was changed:
  (PackageInfo named: 'Kernel') postscript: 'DateAndTime classPool at: #OffsetsAreValid put: true.
+ Timespan withAllSubclassesDo: [ : each | each initialize ].
+ HashedCollection rehashAll.'!
- Timespan withAllSubclassesDo: [ : each | each initialize ]'!



More information about the Squeak-dev mailing list