[HACK] #majorShrink updates to create mini Squeak for 2.7
Dan Ingalls
Dan.Ingalls at disney.com
Sun Jan 9 21:07:10 UTC 2000
>Attached is a fileIn which will create a mini Squeak of 916K (Mac PPC) for
>the 2.7 distribution. This is not quite as tight as the 864K which I was
>getting with 2.6, but a lot of new stuff has been added. It is no way
>definitive; it is just a hack to get a small image corresponding to
>#majorShrink of version 2.4 or thereabouts. Those who know can perhaps
>identify many additional things that can (or should) be removed. Perhaps I
>have removed too much. I would appreciate receiving notice of anything
>fitting either of these categories.
Jerry -
Thanks for your update to majorShrink for 2.7. It all looks reasonable to me. I found that I was able to get things down to 829K by filing in the attached two methods in addition to your changes before executing the shrink. Several things to note:
Only one of these methods helps shrinking.
The other is needed for fileOut-changes to work after the shrink.
After executing the shrink and abandonSources, execute:
Smalltalk allClassesDo: [:c | c zapOrganization].
This is needed because every time you touch a class, it reconstitutes
its organization, and this uses a lot of space (need to fix this).
It seems this happens during abandonSources.
Finally, it's nice to execute
Smalltalk changes initialize
to start with a clean changeSet after the shrink.
I'll fold these changes into updates for 2.7 before moving on to 2.8alpha. Thanks again
- Dan
-----------------------------
!SystemDictionary methodsFor: 'shrinking' stamp: 'di 1/9/2000 11:49'!
discardOddsAndEnds
"This method throws out lots of classes that are not frequently used."
"Smalltalk discardOddsAndEnds"
SystemOrganization removeSystemCategory: 'System-Serial Port'.
SystemOrganization removeSystemCategory: 'Graphics-Symbols'.
SystemOrganization removeSystemCategory: 'Interface-File Contents Browser'.
SystemOrganization removeSystemCategory: 'System-Compression'.
SystemOrganization removeSystemCategory: 'Interface-Explorer'.
Form removeSelector: #edit.
Smalltalk at: #FormView ifPresent:
[:c | c compile: 'defaultControllerClass ^ NoController'
classified: 'controller access'].
Smalltalk removeClassNamed: #FormEditorView.
Smalltalk removeClassNamed: #FormEditor.
SystemOrganization removeSystemCategory: 'Graphics-Paths'.
"bit editor (remove Form editor first):"
Form removeSelector: #bitEdit.
Form removeSelector: #bitEditAt:scale:.
StrikeFont removeSelector: #edit:.
Smalltalk removeClassNamed: #FormButtonCache.
Smalltalk removeClassNamed: #FormMenuController.
Smalltalk removeClassNamed: #FormMenuView.
Smalltalk removeClassNamed: #BitEditor.
"inspector for Dictionaries of Forms"
Dictionary removeSelector: #inspectFormsWithLabel:.
SystemDictionary removeSelector: #viewImageImports.
ScreenController removeSelector: #viewImageImports.
Smalltalk removeClassNamed: #FormHolderView.
Smalltalk removeClassNamed: #FormInspectView.
"experimental hand-drawn character recoginizer:"
ParagraphEditor removeSelector: #recognizeCharacters.
ParagraphEditor removeSelector: #recognizer:.
ParagraphEditor removeSelector: #recognizeCharactersWhileMouseIn:.
Smalltalk removeClassNamed: #CharRecog.
"experimental updating object viewer:"
Object removeSelector: #evaluate:wheneverChangeIn:.
Smalltalk removeClassNamed: #ObjectViewer.
Smalltalk removeClassNamed: #ObjectTracer.
"miscellaneous classes:"
Smalltalk removeClassNamed: #Array2D.
Smalltalk removeClassNamed: #DriveACar.
Smalltalk removeClassNamed: #EventRecorder.
Smalltalk removeClassNamed: #FindTheLight.
Smalltalk removeClassNamed: #PluggableTest.
Smalltalk removeClassNamed: #SystemMonitor.
Smalltalk removeClassNamed: #DocLibrary.
Smalltalk removeClassNamed: #ProtocolBrowser.
Smalltalk removeClassNamed: #ObjectExplorerWrapper.
Smalltalk removeClassNamed: #HierarchyBrowser.
Smalltalk removeClassNamed: #LinkedMessageSet.
Smalltalk removeClassNamed: #ObjectExplorer.
Smalltalk removeClassNamed: #PackageBrowser.
Smalltalk removeClassNamed: #AbstractHierarchicalList.
Smalltalk removeClassNamed: #ChangeList.
Smalltalk removeClassNamed: #VersionsBrowser.
Smalltalk removeClassNamed: #ChangeRecord.
Smalltalk at: #SampledSound ifPresent: [:c |
(Smalltalk confirm: 'Remove all sounds from the SampledSound library?')
ifTrue: [c initialize]].
#(Helvetica Palatino Courier ComicBold ComicPlain) do:
[:k | TextConstants removeKey: k ifAbsent: []].
Preferences setButtonFontTo: (StrikeFont familyName: #NewYork size: 12).
Preferences setFlapsFontTo: (StrikeFont familyName: #NewYork size: 12).
#(GZipConstants ZipConstants KlattResonatorIndices ) do:
[:k | Smalltalk removeKey: k ifAbsent: []].
! !
!ChangeSet methodsFor: 'as yet unclassified' stamp: 'di 1/9/2000 10:54'!
fileOut
"File out the receiver, to a file whose name is a function of the change-set name and either of the date & time or chosen to have a unique numeric tag, depending on the preference 'sequentialChangeSetFileNames'"
| file slips nameToUse |
self checkForConversionMethods.
nameToUse _ Preferences changeSetVersionNumbers
ifTrue:
[FileDirectory default nextNameFor: self name extension: 'cs']
ifFalse:
[(self name, FileDirectory dot, Utilities dateTimeSuffix,
FileDirectory dot, 'cs') asFileName].
Cursor write showWhile:
[file _ FileStream newFileNamed: nameToUse.
file header; timeStamp.
self fileOutPreambleOn: file.
self fileOutOn: file.
self fileOutPostscriptOn: file.
file trailer; close].
Preferences suppressCheckForSlips ifTrue: [^ self].
slips _ self checkForSlips.
(slips size > 0 and: [self confirm: 'Methods in this fileOut have halts
or references to the Transcript
or other ''slips'' in them.
Would you like to browse them?'])
ifTrue: [Smalltalk browseMessageList: slips
name: 'Possible slips in ', name]! !
More information about the Squeak-dev
mailing list
|