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 -
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.
- Bert -
On Mon, May 3, 2010 at 3:15 AM, Bert Freudenberg bert@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@squeakland.org http://lists.squeakland.org/mailman/listinfo/etoys-dev
On 03.05.2010, at 01:34, Korakurider korakurider@gmail.com wrote:
On Mon, May 3, 2010 at 3:15 AM, Bert Freudenberg bert@freudenbergs.de wrote:
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
Awesome. Do we want to keep the InternalTranslator class in the image at all?
- Bert -
On Mon, May 3, 2010 at 10:40 PM, Bert Freudenberg bert@freudenbergs.de wrote:
On 03.05.2010, at 01:34, Korakurider korakurider@gmail.com wrote:
On Mon, May 3, 2010 at 3:15 AM, Bert Freudenberg bert@freudenbergs.de wrote:
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
Awesome. Do we want to keep the InternalTranslator class in the image at all?
It is useful to process legacy translation data. I sometimes use it.
/Korakurider
- Bert -
etoys-dev@lists.squeakfoundation.org