Comment #4 on issue 971 by benjamin...(a)gmail.com: Using Athens fonts is
dead slow in Roassal
http://code.google.com/p/moose-technology/issues/detail?id=971
After loading Athens, then
[|view|
view := ROMondrianViewBuilder new.
view shape label fontSize: [:x | x ].
view nodes: (10 to: 100).
view open]
timeToRun ---> 4767 msec
By cheating...
LogicalFont>>height
^200
LogicalFont>>width
^200
then timeToRun ---> 45msec.
With...
LogicalFont>>height
self realFont "height".
^200.
then timeToRun ---> 1929msec.
If I revert the changes above and then do...
LogicalFont>>realFont
"Smalltalk at: #btcHack put: Bag new"
^realFont ifNil: [
(Smalltalk at: #btcHack) add: #count.
realFont := self findRealFont] ^
then timeToRun --> 4076
and (Smalltalk at: #btcHack) occurrencesOf: #count ---> 587 times it runs
#findRealFont.
This might not be the proper place to do caching, but if change this to...
LogicalFont>>realFont
| cache |
cache := Smalltalk at: #btcHack2 ifAbsentPut: Dictionary new.
^realFont ifNil: [ cache at: self printString ifAbsentPut: [ self
findRealFont ] ]
then timeToRun --> 1482msec.
subsequent runs have timeToRun ---> 65msec.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings