[etoys-dev] Redundant strings in image

Korakurider korakurider at gmail.com
Sun May 2 19:34:45 EDT 2010


On Mon, May 3, 2010 at 3:15 AM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On 02.05.2010, at 18:45, Bert Freudenberg wrote:
>> It's astonishing to me how many copies we have of some strings in the new dev image. They add up to more than 3 MB wasted space! See for yourself:
>>
>> =====================
>> | f strings sorted count wasted |
>> strings := Bag new.
>> String allSubInstances
>>       do: [:s | strings add: s]
>>       displayingProgress: 'counting ...'.
>> sorted := SortedCollection sortBlock: [:a :b | a first >= b first].
>> wasted := 0.
>> strings asSet asArray
>>       do: [:s |
>>               count := strings occurrencesOf: s.
>>               count > 1 ifTrue: [
>>                       wasted := wasted + (count - 1 * s byteSize).
>>                       sorted add: {count*s byteSize. count. s}]]
>>        displayingProgress: 'sorting ...'.
>> f := FileStream newFileNamed: 'bla.txt'.
>> [sorted do: [:each |
>>               f nextPutAll: '==============='; cr.
>>               each do: [:elem | f nextPutAll: elem asString]
>>                       separatedBy: [f space].
>>               f cr]
>>       displayingProgress: 'writing ...'.
>> ] ensure: [f close].
>> wasted asStringWithCommas
>> =====================
>>
>> In comparison, the Etoys 4.0 release image had "only" 600 KB wasted by this.
>>
>> Any idea where those strings could come from?
>>
>> - Bert -
>
> Sorry, false alarm. In a clean dev image it's also about 600 KB. So not worse than before. Still, there are some very strange strings in the image.
>
> Ah, I found a big pile: If I empty the InternalTranslator's caches and translations, the image shrinks by 1.5 MB! Any reason not to do this? I don't think we need the InternalTranslator any more.
    Keeping in-image translation was safety on transition to gettext.
    Now that that stuff has been used in production we could empty caches:-)
/Korakurider

>
> - Bert -
>
>
> _______________________________________________
> etoys-dev mailing list
> etoys-dev at squeakland.org
> http://lists.squeakland.org/mailman/listinfo/etoys-dev
>


More information about the etoys-dev mailing list