Hi Igorit would be good to see how the new text model perform.StefBegin forwarded message:From: Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com>
Subject: Fwd: Small text composition bench
Date: October 10, 2013 10:46:42 PM GMT+02:00
To: St�phane Ducasse <stephane.ducasse@inria.fr>
---------- Forwarded message ----------
From: Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com>
Date: 2013/10/10
Subject: Small text composition bench
To: The general-purpose Squeak developers list <squeak-dev@lists.squeakfoundation.org>
| text |After our changes: 95 msHere is a simple bench:Before our changes: 162 ms
(StringHolder new contents:� (Compiler evaluate: (FileStream fileNamed: 'text.st') contentsOfEntireFile )) openLabel:� 'Working With Squeak 2' .
((SystemWindow allSubInstances detect: [:e | e label = 'Working With Squeak 2']) findDeepSubmorphThat: [:m | m class = PluggableTextMorphPlus] ifAbsent: [] ) textMorph
ifNotNil: [:tm | MessageTally spyOn: [
��� [100 timesRepeat: [(NewParagraph new)
��� ��� compose: tm text
��� ��� style: tm textStyle copy
��� ��� from: 1
��� ��� in: tm container]] timeToRun]].
And my Pharo 3.0 (#30417) (not up to date) :� 364 msThe main gain is avoiding
- the stopConditions copy
- and the TextStopConditions indirection- and of course the Multi* when not necessary (Pharo does not)
Here is the test for Pharo variant:text := Compiler evaluate: (FileSystem workingDirectory parent parent parent / 'text.st' ) readStream contentsOfEntireFile .
(StringHolder new contents:� text) openLabel:� 'Working With Squeak 2' .
((SystemWindow allSubInstances detect: [:e | e label = 'Working With Squeak 2']) findDeepSubmorphThat: [:m | m class = PluggableTextMorph] ifAbsent: [] ) textMorph
ifNotNil: [:tm | MessageTally spyOn: [
��� [100 timesRepeat: [(Paragraph new)
������� compose: text
������� style: tm textStyle copy
������� from: 1
������� in: tm container]] timeToRun]].