Skip to content

Heroes 3 on a dual-core processor.

#18
Auto-translated
A P4 2.8GHz processor. I don't think the absolute processing power matters much, except for its impact on heat dissipation, of course. :) And where did the idea come from that API function calls are the main consumers of processor time, and why are they considered redundant calculations? I looked at the calls in the second Heroes game, and during idle time, the most frequent Win32 call is actually `sleep`. Moreover, the number of these calls isn't that large and clearly exceeds the number of executed assembly instructions by several orders of magnitude. I'm not a big expert in all these matters, but it seems to me that the problem with the infinite loop lies somewhere within the program itself, and not in its calls to external functions. For the third Heroes game, I think 3% of my processor is enough. The remaining 97% is, accordingly, spent on a pointless cycle. When we start stopping the program with a certain periodicity (by calling specific API functions in our case), slowing it down, say, by 50%, then the "useful" part of the Heroes game is left with, accordingly, 1.5%, i.e., half of what is needed. This is if we look at it in the long term, i.e., how the user perceives it. This is where the slowdown comes from. And from the computer's point of view, we are simply creating a certain "free time window" in the processor's time, and when the program wakes up, it continues to churn through pointless cycles in the same proportion to its useful part - 97/3. And this will be the case on any processor, even a 10GHz one. I think that's how it works. Of course, it would be logical to assume that the program learns about external events, which it uses as a guide, through its most frequent calls to the operating system functions, but apparently, it's more complicated than that.