Higher performance?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Higher performance?

tblanchard
Found a preference 'Higher Performance'.

Sounds great, I love performance - what does it do?

Reply | Threaded
Open this post in threaded view
|

Re: Higher performance?

johnmci
If I recall the Morphic polling event loop tries to poll only once  
every 50 ms or is that 60ms. So it's poll for event, tick all the  
morphic creatures, look at the clock and sleep to ensure we do this  
task only once every 20 ms or 16ms? That would give a frame rate of  
50 or 50 fps.

An old bug (perhaps it's back or the fix never gotten in, etc) was  
that it would not consider the time need to tick all morphic  
creatures so the frame rate would be like 40.

Choosing higher performance removes the sleep then you might get 300  
fps.

Older macintosh also suffered from slumberland when on battery and we  
had a preference to prevent
napping.

http://wiki.squeak.org/squeak/160

Support for that feature was removed a few years back when Apple  
obsolete the api's and under os-x napping
is much more uniform anyway.


On Dec 22, 2006, at 7:14 PM, Todd Blanchard wrote:

> Found a preference 'Higher Performance'.
>
> Sounds great, I love performance - what does it do?
>

--
========================================================================
===
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===



Reply | Threaded
Open this post in threaded view
|

Re: Higher performance?

Bert Freudenberg
In reply to this post by tblanchard
On Dec 23, 2006, at 4:14 , Todd Blanchard wrote:

> Found a preference 'Higher Performance'.
>
> Sounds great, I love performance - what does it do?

It gives less processing time back to the OS.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Higher performance?

Brad Fuller-3
In reply to this post by tblanchard
Todd Blanchard wrote:
> Found a preference 'Higher Performance'.
>
> Sounds great, I love performance - what does it do?
>
>

The notes point to:
"May offer higer performance at the expense of other applications on
your computer. See the comment in EventSensor>>higherPerformanceNotes
for more details. NOT advised when running in MVC!"

... no sign of EventSensor>>higherPerformanceNotes.

There are extensive notes in EventSensor (thank you author, whomever you
are!). Also, this might point to it's performance enhancement:


----
WorldState>>doOneCycleFor: aWorld
    "Do one cycle of the interaction loop. This method is called
repeatedly when the world is running.

This is a moderately private method; a better alternative is usually
either to wait for events or to check the state of things from #step
methods."

    self interCyclePause: (Preferences higherPerformance ifTrue: [1]
ifFalse: [MinCycleLapse]).
    self doOneCycleNowFor: aWorld.


-----
WolrdState>>interCyclePause: milliSecs
        "delay enough that the previous cycle plus the amount of delay will
equal milliSecs.  If the cycle is already expensive, then no delay
occurs.  However, if the system is idly waiting for interaction from the
user, the method will delay for a proportionally long time and cause the
overall CPU usage of Squeak to be low."

| currentTime wait |

   (lastCycleTime notNil and: [CanSurrenderToOS ~~ false]) ifTrue: [
     currentTime _ Time millisecondClockValue.
     wait _ lastCycleTime + milliSecs - currentTime.
     (wait > 0 and: [ wait <= milliSecs ] )
     ifTrue: [
       (Delay forMilliseconds: wait) wait ].
     ].

   lastCycleTime _  Time millisecondClockValue.
   CanSurrenderToOS _ true.


--
brad fuller
www.bradfuller.com