[Cuis-dev] [ChangeSet] Performance improvements for Shout in Workspaces
Juan Vuletich
juan at jvuletich.org
Sun Nov 15 16:06:03 PST 2020
Hi Folks,
It has recently brought to my attention that doing printIt in a Workspace of
Array streamContents: [ :s | 5000 timesRepeat: [s nextPut: 100 atRandom
@ 100 atRandom ]].
takes several seconds, but if you disable Shout (Window menu, disable
'syntax highlighting') makes it instant. There are several reasons for this:
- After doing text layout, the workspace text morph realizes contents
large, and a scroll bar is required. This takes off some pixels at the
right side, so there is less space for text. This requires doing text
layout again.
- Then, after doing shout, as some text might have become bold or
italic, changing the font metrics, and possibly what text fits in a
line, text layout is done again!
- Due to a couple of bugs, text layout might be done even once or twice
more!
The numbered attachments make it way faster, besides simplifying and
cleaning the code. Please test and review them.
Additionally #printIt in attach printIt-limitedTo*.cs.st is an
experiment that by limiting the printed result to 10,000 characters, it
makes the example instantaneous even for an array a hundred of times
larger. I think it is a good idea to include it, but if you see an use
case for such large printStrings, please tell.
Thanks,
--
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: printIt-limitedTo-JuanVuletich-2020Nov15-20h22m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201115/eb21cf40/attachment-0006.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4456-DisableWorkspaceShoutBoldItalic-JuanVuletich-2020Nov15-14h26m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201115/eb21cf40/attachment-0007.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4455-extentChangedCoda-JuanVuletich-2020Nov15-14h07m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201115/eb21cf40/attachment-0008.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4454-extentChanged-JuanVuletich-2020Nov15-14h03m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201115/eb21cf40/attachment-0009.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4453-AvoidUnnededRestyles-JuanVuletich-2020Nov15-10h26m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201115/eb21cf40/attachment-0010.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4452-WorkspacesWithScrollBar-JuanVuletich-2020Nov15-10h23m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201115/eb21cf40/attachment-0011.ksh>
More information about the Cuis-dev
mailing list