Re: Another Win32lib problem, and this may not be fixable. Fixed - sort of.....
- Posted by petelomax 1 week ago
- 285 views
I was a little curious myself - this seems faster
My guess would be that the first condition of the if statement leaves a spoolFuncs ref (and probably funcid) in a register which the next six tests can use, whereas the loop reloads every iteration and consequently suffers up to seven times as many AGI (address generation interlock) stalls. Even so, I'm a little surprised you noticed/actually managed to measure any difference, though I guess that makes more sense if all seven tests are failing ~99% of the time. There are plans for a proper register allocator in Phix 2.0.0, should that ever happen.
Actually, for i=1 to length(spoolFuncs) might be an improvement over for i=1 to 7... unless the compiler knows it's always 7 and optimises that length() call away...