Great. I checked a bit the implementation, and I would only suggest to check for isCached in the attributeAt:ifAbsent: method, instead of in every *For: methods.
I instead introduced #cachedNamed:ifAbsentInitializeWith: Not all attributes must be cached (e.g., I am doing some animation on the side)
For archive, I used this expression to check whether I missed some *For: methods. -=-=-=-=-=-=-=-=-=-=-=-= (((PackageInfo named: 'Mondrian') methods select: [:mr | mr selector asString endsWith: 'For:']) collect: [:mr | mr compiledMethod]) select: [:cm | (cm sendsSelector: #cachedNamed:ifAbsentInitializeWith:) not] -=-=-=-=-=-=-=-=-=-=-=-=
I optimized what I could. I am not sure what to do with MOFormsShape although.
The next question is that if the border color is called all the time, what is the use of the bitmap cache?
The bitmap is for not having to display inner nodes. Recursion takes times.
I know, but if you compute it once why do you still need to re-render?
Consider:
view node: 1 forIt: [view node: 2]].
Without the bitmap cache, you display two nodes (e.g., MOBoundedShape>>drawOn: is invoked twice). It is called just once with the bitmap cache.
Alexandre
====== |view o | view := MOViewRenderer new. o := OrderedCollection new: 100. 1 to: 100 do:[:i | o add: i]. (view shape: (MORectangleShape new width: [:e | 200]; height: 200; withBorder; borderColor: [:e | (Delay forMilliseconds: 50) wait. Color gray])). view nodes: o. view layout: (MOGridLayout new gapSize: 1). view open ======
A better version could be
|view o a | a := {0}. view := MOViewRenderer new. o := OrderedCollection new: 100. 1 to: 100 do:[:i | o add: i]. (view shape: (MORectangleShape new width: [:e | 200]; height: 200; withBorder; borderColor: [:e | a at: 1 put: (a first + 1). Color gray])). view nodes: o. view layout: (MOGridLayout new gapSize: 1). view open. a -=-=-=-=-=-=-=-=-=-=-=-=
Just inspect the expression, and see if the array a changes over the time.
Is there any remaining problem left in Mondrian related to the speed issue?
Cheers, Alexandre
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Some battles are better lost than fought."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev