[squeak-dev] The Trunk: Monticello-ul.462.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 26 03:41:23 UTC 2011


Levente Uzonyi uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ul.462.mcz

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

Name: Monticello-ul.462
Author: ul
Time: 26 April 2011, 4:20:27.919 am
UUID: aa640223-b26d-b643-8d1d-8a1ac25deeaa
Ancestors: Monticello-cmm.461

- avoid unnecessary allocations in MCDirectoryRepository >> #allFileNames
- speed up MCFileBasedRepository >> #readableFileNames by caching the hashes of cached MCVersionNames and using a Set for #difference: computation

=============== Diff against Monticello-cmm.461 ===============

Item was changed:
  ----- Method: MCDirectoryRepository>>allFileNames (in category 'accessing') -----
  allFileNames
+ 
+ 	^directory entries 
+ 		sort: [ :a :b | a modificationTime >= b modificationTime ];
+ 		replace: [ :ea | ea name asMCVersionName ]!
- 	^ (directory entries sortBy: [:a :b | a modificationTime >= b modificationTime]) collect: [:ea | ea name asMCVersionName]!

Item was changed:
  ----- Method: MCFileBasedRepository>>readableFileNames (in category 'private-files') -----
  readableFileNames
  	"Answer an Array of MCVersionNames representing every file in this repository; first the ones from the cache (whether or not they still exist in the repository) followed by every other file in this repository that Monticello can read."
+ 	
+ 	| all cached new hashes cachedSet |
- 	| all cached new |
  	all := self allFileNamesOrCache.	"from repository"
  	cached := self cachedFileNames.	"in memory"
+ 	"The following is for caching the hashes of cached MCVersionNames."
+ 	hashes := IdentityDictionary new: cached size.
+ 	cached do: [ :each | hashes at: each put: each hash ].
+ 	cachedSet := PluggableSet new: cached size.
+ 	cachedSet hashBlock: [ :element | hashes at: element ifAbsent: [ 1 ] ].
+ 	cachedSet addAll: cached.
+ 	new := all difference: cachedSet.
- 	new := all difference: cached.
  	^ (cached asArray, new)
  		select: [:ea | self canReadFileNamed: ea]!




More information about the Squeak-dev mailing list