[Vm-dev] Profiling and delay accuracy

tim Rowledge tim at rowledge.org
Fri Jun 15 04:57:17 UTC 2007

The last big change in timer related stuff that I can recall was  
about 3 years ago when I removed the extraordinarily expensive pre-  
and post- primitive call timer checking and reworked many prims to  
explicitly do timer checks if we thought they were plausibly long- 
running. It's when the messing around with the timer feedback stuff  
got done to avoid the catastrophic feedback runaway I discovered.

See the thread on 'primitive timing issues' starting march 16 2004  
and other threads around the same time such as 'User interrupts no  
longer interrupt locked UI process'

To quote from my VMMaker 3.7 beta announcement
"The cumbersome timing of primitives is removed from  
primitiveResponse since
most internal numbered prims are quick. Those that are not use
#forceInterruptCheck to require an ASAP checkForInterrupts. fIC is
essentially idempotent and can be called several times in a prim  
without harm.
I use this instead of simply setting the interruptCheckCounter to 0  
that seems to mess up the feedback mechanism. The external call prim
now has the primitive timing code since many named prims are quite long
operations; I'm still looking for a nice way to improve that. Maybe
changing the codegen to do something clever. I guess the ffi prim ought
to do something similar. Note that this change could be backed out if
the latter two points cause a problem for anyone.  Allowing plugin code
to call forceInterruptCheck requires a step in sqVirtualMachine - but
then Andreas' isArray code had already caused that. Internal code like
ioGetNextEvent(), ioShowDisplay() etc that takes a long time can freely
call fIC if it seems warranted. The evidence so far is that the timer
change is very worthwhile on RISC OS and mildly beneficial on other
platforms. It also allows the more direct usage of function pointers in
the prim table which will have other uses later. :-)"

Around about the same time we did a lot of work to get the delay  
accuracy reasonable and at least plausibly montonic on all platforms.

tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Fractured Idiom:- ICH LIEBE RICH - I'm really crazy about having dough

More information about the Vm-dev mailing list