Hollywood binaries working faster on G4 than on G5?
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Georg
    Posts: 121 from 2004/4/7
    I bet it's the timing code itself. Remove it (GetTimer, StartTimer) and count seconds yourself.
  • »10.03.25 - 18:34
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    koszer
    Posts: 1302 from 2004/2/8
    From: Poland
    Quote:

    jPV wrote:
    I made some further tests now.

    First your Hollywood code can be optimized to much faster, and when doing that, results are more in line with the CPU performance.


    Wow. That's some improvement! Great work.
    The trick with DisableLineHook() really seems to affect the overal performance... at least in current MorphOS version.

    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?

    @Georg: The timer is right. I sure can tell the difference between 14 and 24 seconds even without using a stopper watch.

    [ Edited by koszer 10.03.2025 - 18:43 ]
  • »10.03.25 - 18:41
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Georg
    Posts: 121 from 2004/4/7
    Quote:

    koszer wrote:

    @Georg: The timer is right. I sure can tell the difference between 14 and 24 seconds even without using a stopper watch.


    You could not if for some reason the timer calls themselves were to delay execution several seconds ...
  • »10.03.25 - 19:57
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    koszer
    Posts: 1302 from 2004/2/8
    From: Poland
    Quote:

    Georg wrote:
    You could not if for some reason the timer calls themselves were to delay execution several seconds ...


    I've modified the code to not use timer at all, and not to calculate the seconds at the end. Then, during program execution, I checked the passing seconds on screenbar clock module. I counted 23 till the result showed up in the window.

    I also modified the code according to jPV recomendations. After the tweaking, I get about 1,2 seconds now on my G5.

    If anyone wants to try the "revisited" version of the binary - here it is.
  • »11.03.25 - 06:50
    Profile
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    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 ]
  • »11.03.25 - 06:54
    Profile Visit Website
  • Caterpillar
    Caterpillar
    Posts: 24 from 2022/8/17
    I tested the new executable, and yes, I get 1,1s now on my G5 11,2 Quad 2.5.
  • »11.03.25 - 14:01
    Profile