[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] faster startup 7/n
From: |
Paolo Bonzini |
Subject: |
[Help-smalltalk] faster startup 7/n |
Date: |
Tue, 19 Dec 2006 09:49:45 +0100 |
User-agent: |
Thunderbird 1.5.0.8 (Macintosh/20061025) |
VFS was a hog not only when quitting, but also on startup. This simple
patch brings hello-world time down to 58ms (without copy-on-write) and
42ms (with).
Of these, about 8ms are spent in the last remaining call to
allSubinstancesDo: (in FileDescriptor), but I don't see an easy way to
remove it or to make it faster. The remaining 50ms/34ms are the sheer
startup time.
Paolo
--- orig/kernel/VFS.st
+++ mod/kernel/VFS.st
@@ -228,10 +228,7 @@ update: aspect
filesystems specified by the subclasses upon image load."
(aspect == #returnFromSnapshot or: [ aspect == #finishedSnapshot ])
ifTrue: [
- Registry := LookupTable new.
- self allSubclassesDo: [ :each |
- each fileSystems do: [ :fs | self register: fs forClass: each ]
- ]
+ Registry := nil.
].
(aspect == #aboutToQuit or: [ aspect == #aboutToSnapshot ]) ifTrue: [
self allSubclassesDo: [ :each | each release ].
@@ -262,6 +259,10 @@ vfsFor: fileName name: fsName subPath: s
"Create an instance of a subclass of the receiver, implementing the virtual
file `subPath' inside the `fileName' archive. fsName is the virtual
filesystem name and is used to determine the subclass to be instantiated."
+ Registry isNil ifTrue: [
+ Registry := LookupTable new.
+ self allSubclassesDo: [ :each |
+ each fileSystems do: [ :fs | self register: fs forClass: each ] ] ].
^(Registry at: fsName)
vfsFor: fileName name: fsName subPath: subPath!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Help-smalltalk] faster startup 7/n,
Paolo Bonzini <=