Monticello is ... sloooooooooooow
Avi Bryant
avi.bryant at gmail.com
Tue Apr 19 11:42:23 UTC 2005
On 4/19/05, Andreas Raab <andreas.raab at gmx.de> wrote:
> It looks like the culprit is the exponential explosion of the work being
> done in MCWorkingCopy - since each working copy tries to determine
> whether it #includesMethod:ofClass: and since
> PackageInfo>>includesClass: recomputes the category for each class, and
> since this recomputation uses linear search in SystemOrganization it
> seems that, on average, we have a complexity of
> (SystemOrganization size / 2) * (MCWorkingCopy instanceCount)
> for each method and on my system the above makes something like a
> whopping 160,769 operations when compiling a single methods (2347
> categories, 137 packages).
I've never had anywhere near that many packages, so I've never seen
that, but yes, I can see that would be a problem.
So, how about this:
SystemOrganizer>>numberOfCategoryOfElement: element
| cachedNumber |
cache ifNil: [cache _ Dictionary new].
cachedNumber _ cache at: element ifAbsent: [1].
^ ((self listAtCategoryNumber: cachedNumber) includes: element)
ifTrue: [cachedNumber]
ifFalse: [cache at: element put: (super numberOfCategoryOfElement: element)]
(And choose "instance variable" when it asks what 'cache' is, obviously)
Avi
More information about the Squeak-dev
mailing list
|