[ENH] primitiveYield for 4% speedup (?)

David N. Smith (IBM) dnsmith at watson.ibm.com
Fri Oct 8 01:23:09 UTC 1999


At 15:00 -0700 10/7/99, Tim Rowledge wrote:
>Turning the ProcessorScheduler>yield message into a primitive is 
>very simple. A
>seven statement method in Interpreter does the job.
>
>Using this primitive instead of spawning a new process with a semaphore  will
>not suddenly make world hunger or microsoft disapper, but it does reduce the
>flood of garbage a little and on my Acorn a loop of
>	10000 timesRepeat: [ Processor yield]
>takes 30 millisecs instead of 1680, quite an improvement. If that is the only
>time saving (ie ignore the saved GC time) then Dave Smith's machine would save
>	(1680 - 30) /10000 * 250 =  41.5 mS
>_each_ second, or ~4% performance improvement!  Not bad for an hours work and
>seven lines of code...

I agree! and I even got someone else to do the coding!  ;-)

Dave
_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
_______________________________
Any opinions or recommendations
herein are those of the author
and not of his employer.





More information about the Squeak-dev mailing list