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).! |
On Sun, Sep 11, 2016 at 7:15 PM, <[hidden email]> wrote: Levente Uzonyi uploaded a new version of EToys to project The Trunk: 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 - |
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 - > > > |
Free forum by Nabble | Edit this page |