[squeak-dev] The Inbox: Monticello-topa.585.mcz

Chris Muller asqueaker at gmail.com
Sun Jan 26 17:00:14 UTC 2014


Symbols are one way to canonicalize Strings.  Another way is to
introduce one's own canoncalized IdentityDictionary of author strings.

Whenever a Symbol is not going to be a selector name, I tend to prefer
the latter.

On Sat, Jan 25, 2014 at 3:11 PM, Tobias Pape <Das.Linux at gmx.de> wrote:
> I’m late to the 4.5 wagon, I know.
> Probably this is not much but who knows:
>
> This was hinted by Stephan Eggermont.
> In one image that saved me 100k, but I think in images with much more
> versions loaded (seaside, magma, devel images) this could actually save a bunch.
>
> Best
>         -Tobias
> PS: ignore 584, i had my changes file corrupted.
>
>
> On 25.01.2014, at 21:08, commits at source.squeak.org wrote:
>
>> A new version of Monticello was added to project The Inbox:
>> http://source.squeak.org/inbox/Monticello-topa.585.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Monticello-topa.585
>> Author: topa
>> Time: 25 January 2014, 10:08:51.15 pm
>> UUID: ff122640-845a-402a-bd97-9fc79daea119
>> Ancestors: Monticello-cmm.583
>>
>> The number of distinct authors in the image is low:
>> (MCVersionInfo allInstances collect: [ :each | each author ]) asIdentitySet size. "13336"
>> (MCVersionInfo allInstances collect: [ :each | each author ]) asSet size. "128"
>>
>> Hence, we can safely store them as symbols.
>> This does not save much memory in a small image but should in
>> production images.
>>
>> =============== Diff against Monticello-cmm.583 ===============
>>
>> Item was changed:
>>  ----- Method: MCVersionInfo>>asDictionary (in category 'converting') -----
>>  asDictionary
>>       ^ Dictionary new
>>               at: #name put: name;
>>               at: #id put: id asString;
>>               at: #message put: message;
>>               at: #date put: date;
>>               at: #time put: time;
>> +             at: #author put: self author;
>> -             at: #author put: author;
>>               at: #ancestors put: (self ancestors collect: [:a | a asDictionary]);
>>               yourself!
>>
>> Item was changed:
>>  ----- Method: MCVersionInfo>>author (in category 'pillaging') -----
>>  author
>> +     ^ author asString!
>> -     ^ author!
>>
>> Item was changed:
>>  ----- Method: MCVersionInfo>>initializeWithName:id:message:date:time:author:ancestors:stepChildren: (in category 'initialize-release') -----
>>  initializeWithName: vName id: aUUID message: aString date: aDate time: aTime author: initials ancestors: aCollection stepChildren: stepCollection
>>       name := vName asString asMCVersionName.
>>       id := aUUID.
>>       message := aString.
>>       date := aDate.
>>       time := aTime.
>> +     author := initials ifNotNil: [:str | str asSymbol].
>> -     author := initials.
>>       ancestors :=  aCollection.
>>       stepChildren := stepCollection!
>>
>> Item was changed:
>>  ----- Method: MCVersionInfo>>summaryHeader (in category 'accessing') -----
>>  summaryHeader
>>       ^ String streamContents:
>>               [:s |
>>               s
>>                       nextPutAll: 'Name: '; nextPutAll: self name; cr.
>>               date ifNotNil:
>>                       [s
>> +                             nextPutAll: 'Author: '; nextPutAll: self author; cr;
>> -                             nextPutAll: 'Author: '; nextPutAll: author; cr;
>>                               nextPutAll: 'Time: '; nextPutAll:  date asString, ', ', time asString; cr].
>>               id ifNotNil:
>>                       [s nextPutAll: 'UUID: '; nextPutAll: id asString; cr].
>>               s
>>                       nextPutAll: 'Ancestors: '; nextPutAll: self ancestorString.
>>               self stepChildren isEmpty ifFalse:
>>                       [s cr; nextPutAll: 'Backported From: '; nextPutAll: self stepChildrenString].
>>               ]!
>>
>> Item was added:
>> + (PackageInfo named: 'Monticello') postscript: '(MCVersionInfo allInstances select: [ :ea | (ea instVarNamed: ''author'') isSymbol not ])
>> + do: [ :ea | ea instVarNamed: ''author'' put: (ea instVarNamed: ''author'') asSymbol]
>> + '!
>>
>>
>
>
>
>


More information about the Squeak-dev mailing list