Chris Muller uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-cmm.461.mcz ==================== Summary ==================== Name: Monticello-cmm.461 Author: cmm Time: 24 April 2011, 7:16:14.664 pm UUID: 8bac38b5-8083-4b26-9b55-3c26fd8bc16f Ancestors: Monticello-nice.460 - Extend support for MCConfigurations to regular MCDirectoryRepository's. - Categorized some methods. - Constructor method for MCDirectoryRepository. - Fixed memory-leak; when a repository adds to its 'cache', it should always keep it resized. =============== Diff against Monticello-nice.460 =============== Item was added: + ----- Method: MCDirectoryRepository class>>creationTemplateLocation: (in category 'configuring') ----- + creationTemplateLocation: location + ^ self name , ' path: {1}' format: {location printString}! Item was changed: + ----- Method: MCDirectoryRepository class>>description (in category 'configuring') ----- - ----- Method: MCDirectoryRepository class>>description (in category 'instance creation') ----- description ^ 'directory'! Item was added: + ----- Method: MCDirectoryRepository class>>directory: (in category 'instance creation') ----- + directory: aFileDirectory + ^ self new + directory: aFileDirectory ; + yourself! Item was added: + ----- Method: MCDirectoryRepository class>>fillInTheBlankRequest (in category 'configuring') ----- + fillInTheBlankRequest + ^ 'Directory Location:'! Item was changed: + ----- Method: MCDirectoryRepository class>>morphicConfigure (in category 'configuring') ----- - ----- Method: MCDirectoryRepository class>>morphicConfigure (in category 'instance creation') ----- morphicConfigure ^ FileList2 modalFolderSelector ifNotNil: [:directory | self new directory: directory]! Item was added: + ----- Method: MCDirectoryRepository class>>path: (in category 'instance creation') ----- + path: fullyQualifiedName + ^ self directory: (FileDirectory on: fullyQualifiedName)! Item was changed: + ----- Method: MCDirectoryRepository>>allFileNames (in category 'accessing') ----- - ----- Method: MCDirectoryRepository>>allFileNames (in category 'as yet unclassified') ----- allFileNames ^ (directory entries sortBy: [:a :b | a modificationTime >= b modificationTime]) collect: [:ea | ea name asMCVersionName]! Item was added: + ----- Method: MCDirectoryRepository>>creationTemplate (in category 'accessing') ----- + creationTemplate + ^ super creationTemplate + ifNil: + [ self creationTemplate: (self class creationTemplateLocation: self directory pathName). + creationTemplate ]! Item was changed: + ----- Method: MCDirectoryRepository>>description (in category 'accessing') ----- - ----- Method: MCDirectoryRepository>>description (in category 'as yet unclassified') ----- description ^ directory pathName! Item was changed: + ----- Method: MCDirectoryRepository>>directory (in category 'accessing') ----- - ----- Method: MCDirectoryRepository>>directory (in category 'as yet unclassified') ----- directory ^ directory! Item was changed: + ----- Method: MCDirectoryRepository>>directory: (in category 'accessing') ----- - ----- Method: MCDirectoryRepository>>directory: (in category 'as yet unclassified') ----- directory: aDirectory directory := aDirectory! Item was changed: + ----- Method: MCDirectoryRepository>>initialize (in category 'accessing') ----- - ----- Method: MCDirectoryRepository>>initialize (in category 'as yet unclassified') ----- initialize directory := FileDirectory default! Item was changed: + ----- Method: MCDirectoryRepository>>isValid (in category 'accessing') ----- - ----- Method: MCDirectoryRepository>>isValid (in category 'as yet unclassified') ----- isValid ^directory exists! Item was changed: + ----- Method: MCDirectoryRepository>>readStreamForFileNamed:do: (in category 'accessing') ----- - ----- Method: MCDirectoryRepository>>readStreamForFileNamed:do: (in category 'as yet unclassified') ----- readStreamForFileNamed: aString do: aBlock | file val | file := FileStream readOnlyFileNamed: (directory fullNameFor: aString). val := aBlock value: file. file close. ^ val! Item was changed: + ----- Method: MCDirectoryRepository>>writeStreamForFileNamed:replace:do: (in category 'accessing') ----- - ----- Method: MCDirectoryRepository>>writeStreamForFileNamed:replace:do: (in category 'as yet unclassified') ----- writeStreamForFileNamed: aString replace: aBoolean do: aBlock | file sel | sel := aBoolean ifTrue: [#forceNewFileNamed:] ifFalse: [#newFileNamed:]. file := FileStream perform: sel with: (directory fullNameFor: aString). aBlock value: file. file close.! Item was changed: + ----- Method: MCFileBasedRepository class>>cleanUp (in category 'release') ----- - ----- Method: MCFileBasedRepository class>>cleanUp (in category 'class initialization') ----- cleanUp "Flush caches" self flushAllCaches.! Item was changed: + ----- Method: MCFileBasedRepository class>>flushAllCaches (in category 'release') ----- - ----- Method: MCFileBasedRepository class>>flushAllCaches (in category 'as yet unclassified') ----- flushAllCaches self allSubInstancesDo: [:ea | ea flushCache]! Item was changed: ----- Method: MCFileBasedRepository>>basicStoreVersion: (in category 'overriding') ----- + basicStoreVersion: aMCVersionOrConfiguration - basicStoreVersion: aVersion self + writeStreamForFileNamed: aMCVersionOrConfiguration fileName + do: [ : s | aMCVersionOrConfiguration fileOutOn: s ]. + aMCVersionOrConfiguration isCacheable ifTrue: + [ cache ifNil: [ cache := Dictionary new ]. + self resizeCache: cache. + cache + at: aMCVersionOrConfiguration fileName + put: aMCVersionOrConfiguration ]! - writeStreamForFileNamed: aVersion fileName - do: [:s | aVersion fileOutOn: s]. - aVersion isCacheable ifTrue: [ - cache ifNil: [cache := Dictionary new]. - cache at: aVersion fileName put: aVersion]. - ! Item was changed: + ----- Method: MCHttpRepository class>>creationTemplate (in category 'ui-support') ----- - ----- Method: MCHttpRepository class>>creationTemplate (in category 'as yet unclassified') ----- creationTemplate ^self creationTemplateLocation: 'http://www.squeaksource.com/ProjectName' user: 'squeak' password: 'squeak' ! Item was changed: + ----- Method: MCHttpRepository class>>creationTemplateLocation:user:password: (in category 'ui-support') ----- - ----- Method: MCHttpRepository class>>creationTemplateLocation:user:password: (in category 'as yet unclassified') ----- creationTemplateLocation: location user: user password: password ^ 'MCHttpRepository location: {1} user: {2} password: {3}' format: {location printString. user printString. password printString}! Item was changed: + ----- Method: MCHttpRepository class>>description (in category 'ui-support') ----- - ----- Method: MCHttpRepository class>>description (in category 'as yet unclassified') ----- description ^ 'HTTP'! Item was changed: + ----- Method: MCHttpRepository class>>fillInTheBlankRequest (in category 'ui-support') ----- - ----- Method: MCHttpRepository class>>fillInTheBlankRequest (in category 'as yet unclassified') ----- fillInTheBlankRequest ^ 'HTTP Repository:' ! Item was changed: + ----- Method: MCHttpRepository class>>location:user:password: (in category 'ui-support') ----- - ----- Method: MCHttpRepository class>>location:user:password: (in category 'as yet unclassified') ----- location: location user: user password: password ^ self new location: location; user: user; password: password! Item was changed: + ----- Method: MCHttpRepository class>>morphicConfigure (in category 'ui-support') ----- - ----- Method: MCHttpRepository class>>morphicConfigure (in category 'as yet unclassified') ----- morphicConfigure ^ self fillInTheBlankConfigure! Item was changed: ----- Method: MCRepository class>>location:username:password: (in category 'instance creation') ----- location: urlOrPath username: user password: pass "Answer an MCRepository for the given url or path. Accepted locations are: - http, and ftp urls (i.e., http://source.squeak.org/trunk) - directory paths (i.e., C:\Squeak\packages) - directory matches (i.e., C:\Squeak\packages\*) If provided, the supplied user name and password will be used." | url | (urlOrPath findString: '://') > 0 ifTrue:[ url := urlOrPath asUrl. url scheme caseOf: { ['ftp'] -> [^MCFtpRepository host: url authority directory: url pathString allButFirst user: user password: user]. ['http'] -> [^MCHttpRepository location: urlOrPath user: user password: pass]. } otherwise:[^self error: 'Unsupported scheme: ', url scheme]. ]. (urlOrPath endsWith: '*') ifTrue:[ ^MCSubDirectoryRepository new directory: (FileDirectory on: urlOrPath allButLast)]. + ^MCDirectoryRepository - ^MCDirectoryRepository new directory: (FileDirectory on: urlOrPath)! Item was changed: ----- Method: MCRepository>>creationTemplate: (in category 'accessing') ----- + creationTemplate: aString + creationTemplate := aString! - creationTemplate: aString - self creationTemplate ifNotNil: [ self error: 'Creation template already set for this MCRepository instance.' ]. - - creationTemplate := aString.! Item was changed: ----- Method: MCRepository>>storeVersion: (in category 'accessing') ----- + storeVersion: aMCVersionOrConfiguration + self basicStoreVersion: (self prepareVersionForStorage: aMCVersionOrConfiguration). + self sendNotificationsForVersion: aMCVersionOrConfiguration! - storeVersion: aVersion - self basicStoreVersion: (self prepareVersionForStorage: aVersion). - self sendNotificationsForVersion: aVersion! Item was changed: ----- Method: MCVersionReader class>>loadVersionFile: (in category 'file services') ----- + loadVersionFile: fileName - loadVersionFile: fileName | version | version := self versionFromFile: fileName. + version workingCopy repositoryGroup addRepository: (MCDirectoryRepository path: (FileDirectory dirPathFor: fileName)). + version load! - version workingCopy repositoryGroup addRepository: - (MCDirectoryRepository new directory: - (FileDirectory on: (FileDirectory dirPathFor: fileName))). - version load. - ! Item was changed: ----- Method: MCVersionReader class>>loadVersionStream:fromDirectory: (in category '*monticello-file services') ----- loadVersionStream: stream fromDirectory: directory | version | version := self versionFromStream: stream. directory isRemoteDirectory ifFalse: [ version workingCopy repositoryGroup addRepository: + (MCDirectoryRepository directory: directory). ]. - (MCDirectoryRepository new directory: directory). ]. version load. ! |
On Mon, 25 Apr 2011, [hidden email] wrote:
> Chris Muller uploaded a new version of Monticello to project The Trunk: > http://source.squeak.org/trunk/Monticello-cmm.461.mcz > > ==================== Summary ==================== > > Name: Monticello-cmm.461 > Author: cmm > Time: 24 April 2011, 7:16:14.664 pm > UUID: 8bac38b5-8083-4b26-9b55-3c26fd8bc16f > Ancestors: Monticello-nice.460 > > - Extend support for MCConfigurations to regular MCDirectoryRepository's. > - Categorized some methods. > - Constructor method for MCDirectoryRepository. > - Fixed memory-leak; when a repository adds to its 'cache', it should always keep it resized. There are two new failing tests after these changes: - MCSnapshotTest >> #testCreation - MCChangeNotificationTest >> #testExtMethodModified Also, some tests sometimes fail, because they ran for more than five seconds (on my pc with Cog). The cause of the slowdown is MCFileBasedRepository >> #readableFileNames's #difference: calculation (O(n*m) runtime). In theory it would be faster (O(n+m)) to create a Set from the argument, but calculating the hash (and the equality) of MCVersionName is too slow to make this faster in practical cases. Levente |
On Mon, 25 Apr 2011, Levente Uzonyi wrote:
> On Mon, 25 Apr 2011, [hidden email] wrote: > >> Chris Muller uploaded a new version of Monticello to project The Trunk: >> http://source.squeak.org/trunk/Monticello-cmm.461.mcz >> >> ==================== Summary ==================== >> >> Name: Monticello-cmm.461 >> Author: cmm >> Time: 24 April 2011, 7:16:14.664 pm >> UUID: 8bac38b5-8083-4b26-9b55-3c26fd8bc16f >> Ancestors: Monticello-nice.460 >> >> - Extend support for MCConfigurations to regular MCDirectoryRepository's. >> - Categorized some methods. >> - Constructor method for MCDirectoryRepository. >> - Fixed memory-leak; when a repository adds to its 'cache', it should >> always keep it resized. > > There are two new failing tests after these changes: > - MCSnapshotTest >> #testCreation > - MCChangeNotificationTest >> #testExtMethodModified I guess these failures depend on the order of the execution of the tests. For some reason #mockClassExtension is removed and not restored, which is the cause of the failure. Restoring the method makes the tests pass. > > Also, some tests sometimes fail, because they ran for more than five seconds > (on my pc with Cog). The cause of the slowdown is MCFileBasedRepository >> > #readableFileNames's #difference: calculation (O(n*m) runtime). In theory it > would be faster (O(n+m)) to create a Set from the argument, but calculating > the hash (and the equality) of > MCVersionName is too slow to make this faster in practical cases. The main cause of the slowdown was that the package cache was not cleaned up after the test runs. I had a few hundred versions of Tests-Monticello-Mocks in my package cache, and 33 new was generated after each test run. I commited a few performance improvements, which results in 25% faster (the actual speedup depends on the size of your package cache) test runs (All MC tests) even with the fixed package cache cleanup. Levente > > > Levente > > |
Good improvements, thanks!
On Mon, Apr 25, 2011 at 10:56 PM, Levente Uzonyi <[hidden email]> wrote: > On Mon, 25 Apr 2011, Levente Uzonyi wrote: > >> On Mon, 25 Apr 2011, [hidden email] wrote: >> >>> Chris Muller uploaded a new version of Monticello to project The Trunk: >>> http://source.squeak.org/trunk/Monticello-cmm.461.mcz >>> >>> ==================== Summary ==================== >>> >>> Name: Monticello-cmm.461 >>> Author: cmm >>> Time: 24 April 2011, 7:16:14.664 pm >>> UUID: 8bac38b5-8083-4b26-9b55-3c26fd8bc16f >>> Ancestors: Monticello-nice.460 >>> >>> - Extend support for MCConfigurations to regular MCDirectoryRepository's. >>> - Categorized some methods. >>> - Constructor method for MCDirectoryRepository. >>> - Fixed memory-leak; when a repository adds to its 'cache', it should >>> always keep it resized. >> >> There are two new failing tests after these changes: >> - MCSnapshotTest >> #testCreation >> - MCChangeNotificationTest >> #testExtMethodModified > > I guess these failures depend on the order of the execution of the tests. > For some reason #mockClassExtension is removed and not restored, which is > the cause of the failure. Restoring the method makes the tests pass. > >> >> Also, some tests sometimes fail, because they ran for more than five >> seconds (on my pc with Cog). The cause of the slowdown is >> MCFileBasedRepository >> #readableFileNames's #difference: calculation >> (O(n*m) runtime). In theory it would be faster (O(n+m)) to create a Set from >> the argument, but calculating the hash (and the equality) of >> MCVersionName is too slow to make this faster in practical cases. > > The main cause of the slowdown was that the package cache was not cleaned up > after the test runs. I had a few hundred versions of Tests-Monticello-Mocks > in my package cache, and 33 new was generated after each test run. I > commited a few performance improvements, which results in 25% faster (the > actual speedup depends on the size of your package cache) test runs (All MC > tests) even with the fixed package cache cleanup. > > > Levente > >> >> >> Levente >> >> > > |
Free forum by Nabble | Edit this page |