[Pharo-project] A design question
Hi I would like to get your point of view on the following: In Object there is the method updateThresholdForGraphicInViewerTab "When a Viewer is open on the receiver, its tab needs some graphic to show to the user. Computing this graphic can take quite some time so we want to make the update frequency depending on how long it takes to compute the thumbnail. The threshold returned by this method defines that the viewer will update at most every 'threshold * timeItTakesToDraw' milliseconds. Thus, if the time for computing the receiver's thumbnail is 200 msecs and the the threshold is 10, the viewer will update at most every two seconds." ^20 "seems to be a pretty good general choice" which is only defined on Object. and only called by ThumbnailMorph>>stepTime "Adjust my step time to the time it takes drawing my referent" drawTime ifNil:[^ 250]. ^(objectToView updateThresholdForGraphicInViewerTab * drawTime) max: 250. and I was thinking ok this a nice hook and may be it should be a morphic extension on Object. On the other hand it seems that this is a feature that is only use by one class that is not even core. So may be we could put the magic number inside the step time. Stef
It depends whether it makes sense or not to have a different threshold for objects. Maybe an expert in gui may help to answer this... Alexandre On 23 Dec 2008, at 19:19, Stéphane Ducasse wrote:
Hi
I would like to get your point of view on the following: In Object there is the method
updateThresholdForGraphicInViewerTab "When a Viewer is open on the receiver, its tab needs some graphic to show to the user. Computing this graphic can take quite some time so we want to make the update frequency depending on how long it takes to compute the thumbnail. The threshold returned by this method defines that the viewer will update at most every 'threshold * timeItTakesToDraw' milliseconds. Thus, if the time for computing the receiver's thumbnail is 200 msecs and the the threshold is 10, the viewer will update at most every two seconds." ^20 "seems to be a pretty good general choice"
which is only defined on Object. and only called by
ThumbnailMorph>>stepTime "Adjust my step time to the time it takes drawing my referent" drawTime ifNil:[^ 250]. ^(objectToView updateThresholdForGraphicInViewerTab * drawTime) max: 250.
and I was thinking ok this a nice hook and may be it should be a morphic extension on Object. On the other hand it seems that this is a feature that is only use by one class that is not even core. So may be we could put the magic number inside the step time.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
yes but so far none of the moprh class specialised this method. On Dec 24, 2008, at 2:00 PM, Alexandre Bergel wrote:
It depends whether it makes sense or not to have a different threshold for objects. Maybe an expert in gui may help to answer this...
Alexandre
On 23 Dec 2008, at 19:19, Stéphane Ducasse wrote:
Hi
I would like to get your point of view on the following: In Object there is the method
updateThresholdForGraphicInViewerTab "When a Viewer is open on the receiver, its tab needs some graphic to show to the user. Computing this graphic can take quite some time so we want to make the update frequency depending on how long it takes to compute the thumbnail. The threshold returned by this method defines that the viewer will update at most every 'threshold * timeItTakesToDraw' milliseconds. Thus, if the time for computing the receiver's thumbnail is 200 msecs and the the threshold is 10, the viewer will update at most every two seconds." ^20 "seems to be a pretty good general choice"
which is only defined on Object. and only called by
ThumbnailMorph>>stepTime "Adjust my step time to the time it takes drawing my referent" drawTime ifNil:[^ 250]. ^(objectToView updateThresholdForGraphicInViewerTab * drawTime) max: 250.
and I was thinking ok this a nice hook and may be it should be a morphic extension on Object. On the other hand it seems that this is a feature that is only use by one class that is not even core. So may be we could put the magic number inside the step time.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Wed, Dec 24, 2008 at 14:27, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
yes but so far none of the moprh class specialised this method.
it's not used => remove it
On Dec 24, 2008, at 2:00 PM, Alexandre Bergel wrote:
It depends whether it makes sense or not to have a different threshold for objects.
I'm not convinced by that threshold thing. If you need to update something, either you have realtime constraints, or you just want to limit CPU usage, in which case it's the scheduler's responsibility to respect whatever low priority you give to the update task⦠no? -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
I think that this is the morph scheduler model that is wrong. but unfortunately I'm not good enough in concurrent programming to fix. I remember that once nathanael told me that it was bogus by construction and that he understood how to do a good one. Too bad google took him :) On Dec 24, 2008, at 4:19 PM, Damien Pollet wrote:
On Wed, Dec 24, 2008 at 14:27, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
yes but so far none of the moprh class specialised this method.
it's not used => remove it
On Dec 24, 2008, at 2:00 PM, Alexandre Bergel wrote:
It depends whether it makes sense or not to have a different threshold for objects.
I'm not convinced by that threshold thing. If you need to update something, either you have realtime constraints, or you just want to limit CPU usage, in which case it's the scheduler's responsibility to respect whatever low priority you give to the update task⦠no?
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (3)
-
Alexandre Bergel -
Damien Pollet -
Stéphane Ducasse