The Trunk: EToys-ul.232.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: EToys-ul.232.mcz

commits-2
Levente Uzonyi uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-ul.232.mcz

==================== Summary ====================

Name: EToys-ul.232
Author: ul
Time: 11 September 2016, 7:15:09.419613 pm
UUID: 666e68e0-6e23-4f51-88d8-bdb6b9f4bd0e
Ancestors: EToys-dtl.231

(hopefully) Shave off a few extra minutes of EToys loading by using Schwartzian transform in Morph class >> #unfilteredCategoriesForViewer.
The real culprit is the "new" implementation of String >> #translated, which came with the EToys changes and is at least two magnitudes slower than the previous implementation.

=============== Diff against EToys-dtl.231 ===============

Item was changed:
  ----- Method: Morph class>>unfilteredCategoriesForViewer (in category '*Etoys') -----
  unfilteredCategoriesForViewer
  "Answer a list of symbols representing the categories to offer in the viewer for one of my instances, in order of:
  - masterOrderingOfCategorySymbols first
  - others last in order by translated wording"
  "
  Morph unfilteredCategoriesForViewer
  "
 
  | aClass additions masterOrder |
  aClass := self.
  additions := OrderedCollection new.
+ [ aClass == Morph superclass ] whileFalse: [
- [aClass == Morph superclass ] whileFalse: [
  additions addAll: (aClass allAdditionsToViewerCategories keys asArray
+ "#translated can be super slow, so use Schwartzian transform"
+ replace: [ :each | each -> each translated ];
+ sort: [ :a :b | a value <= b value ];
+ replace: [ :each | each key ]).
- sort: [ :a :b | a translated < b translated ]).
  aClass := aClass superclass ].
 
  masterOrder := EToyVocabulary masterOrderingOfCategorySymbols.
 
  ^(masterOrder intersection: additions), (additions difference: masterOrder).!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: EToys-ul.232.mcz

Bert Freudenberg
On Sun, Sep 11, 2016 at 7:15 PM, <[hidden email]> wrote:
Levente Uzonyi uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-ul.232.mcz

==================== Summary ====================

Name: EToys-ul.232
Author: ul
Time: 11 September 2016, 7:15:09.419613 pm
UUID: 666e68e0-6e23-4f51-88d8-bdb6b9f4bd0e
Ancestors: EToys-dtl.231

(hopefully) Shave off a few extra minutes of EToys loading by using Schwartzian transform in Morph class >> #unfilteredCategoriesForViewer.
The real culprit is the "new" implementation of String >> #translated, which came with the EToys changes and is at least two magnitudes slower than the previous implementation.


Ah. #translated relies on the translation dictionaries actually being loaded. If it doesn't find the translation in the default dict, it scans all other dictionaries which is indeed very slow.

So while this is a great improvement, we maybe should have a fast #translated fail code if there are no translations at all.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: EToys-ul.232.mcz

Levente Uzonyi
On Mon, 12 Sep 2016, Bert Freudenberg wrote:

> On Sun, Sep 11, 2016 at 7:15 PM, <[hidden email]> wrote:
>       Levente Uzonyi uploaded a new version of EToys to project The Trunk:
>       http://source.squeak.org/trunk/EToys-ul.232.mcz
>
>       ==================== Summary ====================
>
>       Name: EToys-ul.232
>       Author: ul
>       Time: 11 September 2016, 7:15:09.419613 pm
>       UUID: 666e68e0-6e23-4f51-88d8-bdb6b9f4bd0e
>       Ancestors: EToys-dtl.231
>
>       (hopefully) Shave off a few extra minutes of EToys loading by using Schwartzian transform in Morph class >> #unfilteredCategoriesForViewer.
>       The real culprit is the "new" implementation of String >> #translated, which came with the EToys changes and is at least two magnitudes slower than the previous implementation.
>
>
> Ah. #translated relies on the translation dictionaries actually being loaded. If it doesn't find the translation in the default dict, it scans all other dictionaries which is indeed very slow.
>
> So while this is a great improvement, we maybe should have a fast #translated fail code if there are no translations at all.

Definitely that's the way to go.

Levente

>
> - Bert -
>
>
>