Yokemate of Keyboards
Posts: 2140 from 2003/2/24
From: po-RNO
Quote:
koszer wrote:
The trick with DisableLineHook() really seems to affect the overal performance... at least in current MorphOS version.
Yeah, it really affects in this kind of situations, and it should too, that's expected. The line hook is something where Hollywood does its maintenance work after each line of code. And in this particular case you're executing 3 million lines as quick as possible, so any overhead shows there. For normal not looping code it shouldn't be noticeable or even measurable, because you're doing only single lines at once. The only weird thing is why G5 is that much slower with the line hook than G4, at least in this case...
Quote:
So basically you're saying that my (poorly optimized) code triggered some feature in MorphOS itself that dramatically cut the performance of G5 CPUs? And that feature has been somewhat fixed in 3.20?
Pretty much so, at least it quickly looks like it. If we'd want to know better, we should test more if it's about the line hook itself (which would generally slow down programs everywhere where you don't disable it temporarily, even if not noticeable) or could it be some math calculation that happens to hit some non-optimal feature in MorphOS (although why wouldn't it show when the line hook is disabled).
But as it seems to be solved in the upcoming MorphOS release already, I don't know if it's worth to spend too much time to debug this more... but if anyone wants to make more tests, it would be interesting to hear about any findings. Just changing things in the loop to see if it performs in other way between G4 and G5 with some other kind of code when the line hook is left enabled...
[ Edited by jPV 11.03.2025 - 08:12 ]