[BUG] why is frame rate in 3.2.5 slower?

Andreas Raab Andreas.Raab at gmx.de
Mon Mar 11 12:08:37 UTC 2002


John,

> sigh, of course now I need to understand why exactly we have a 5 ms 
> lag on returning from Delay. Oh that should be fun to track.

Check the millisecond accuracy. Question 1 is what do you get when run
something like:

| bag time |
bag := Bag new.
time := Time millisecondClockValue.
1 to: 1000 do:[:i|
	[Time millisecondClockValue = time] whileTrue.
	bag add: (Time millisecondClockValue - time).
	time := Time millisecondClockValue.
].
bag sortedCounts

This will give you the "raw" timer accuracy. However, even if you get
1msec here that's only the first part of the problem. The second is what
happens when you run:

| bag time delay |
delay := Delay forMilliseconds: 1.
bag := Bag new.
1 to: 1000 do:[:i|
	time := Time millisecondClockValue.
	delay wait.
	bag add: (Time millisecondClockValue - time).
].
bag sortedCounts

I noticed that even after fixing the raw timer accuracy, the second one
still lagged. The solution I found was to use an OS timer callback which
had to reset the interruptCheckCounter in order to force a check for
pending delay timeouts. This slightly decreases general performance
(since you're checking 1000 times/sec) but it was less then 1% and gives
very exact results. It turns out that after these changes I was able to
_drastically_ reduce the sound player's buffer size without noticable
distortion.

Cheers,
  - Andreas





More information about the Squeak-dev mailing list