dalehenrich / filetree

Monticello repository for directory-based Monticello packages enabling the use of git, svn, etc. for managing Smalltalk source code.
https://github.com/CampSmalltalk/Cypress
MIT License
133 stars 26 forks source link

Performance problems when opening large filetree repository in Monticello Browser #153

Closed numberpi closed 9 years ago

numberpi commented 9 years ago

Opening a filetree repository takes ~40 seconds on my local machine (repository folder contains ~6000 files, 900 folders).

After some tallying I found the reference to #132 in MCDirectoryRepository>>cacheAllFileNamesDuring: which causes the performance issue. While opening the repository, the filename cache is recreated over and over again, but it has to be reloaded only once in the beginning.

I would suggest something like that:

cacheAllFileNamesDuring: aBlock 
    "https://github.com/dalehenrich/filetree/issues/132"
    | resetInternalCall |
    resetInternalCall := false.
    internalCall ifFalse: [internalCall := true.
        resetInternalCall := true.
        allFileNamesCache := nil.].

    ^ [super cacheAllFileNamesDuring: aBlock]
        ensure: [resetInternalCall ifTrue: [internalCall := false]]

This reduces the time to open the repo window to ~2 seconds.

dalehenrich commented 9 years ago

@numberpi would you mind submitting a pull request against the Squeak4.3 branch with this patch? I am pretty busy and if you wait for me, I'll integrate this fix when I make my next (annual?) swing through Filetree:)

numberpi commented 9 years ago

@dalehenrich I will do it next time I get my hands on a Unix machine, because my first approach to implement it using Windows failed, cause I am unable to checkout files like "https://github.com/dalehenrich/filetree/blob/master/tests/testRepositories/ver03/Cypress-Mocks.pkg/snapshot/classes/CypressMockBasic.class/instance/name:.st" due to the colon in the filepath

dalehenrich commented 9 years ago

Hmmm, that is a test repository for a version of filetree/cypress that was not stripping illegal characters out of the file name ... so you could make a branch that just dropped that file on the floor ....or even rename the file to something different ... file names have never been significant to filetree/cypress ... the filenames are for humans.

Dale On 03/27/2015 04:13 AM, Daniel Stolpe wrote:

@dalehenrich https://github.com/dalehenrich I will do it next time I get my hands on a Unix machine, because my first approach to implement it using Windows failed, cause I am unable to checkout files like "https://github.com/dalehenrich/filetree/blob/master/tests/testRepositories/ver03/Cypress-Mocks.pkg/snapshot/classes/CypressMockBasic.class/instance/name:.st" due to the colon in the filepath

— Reply to this email directly or view it on GitHub https://github.com/dalehenrich/filetree/issues/153#issuecomment-86903910.

krono commented 9 years ago

bump

krono commented 9 years ago

I merged the _dev into squeak4.3

Dale, how was the process to make it the default?

dalehenrich commented 9 years ago

Do you mean to deploy it to ss3?

krono commented 9 years ago

I just want people who install filetree either directly or via a metacello bootstrap to end up with the right version. Do I have to change any Baseline/Config?

dalehenrich commented 9 years ago

No ... FileTree is pretty much under continuous release ... once you put a change out on the platform branch, folks should pick it up the next time they load/reload, since the project refs in Baseline/Config should reference the branch itself like this:

Metacello new
  baseline: 'FileTree';
  repository: 'github://dalehenrich/filetree:squeak4.3/repository';
  load.
krono commented 9 years ago

Good, then I'd like to consider this here deployed and good to close. Counter arguments? :)

dalehenrich commented 9 years ago

nope ship it!