Post Reply 
Varying speed of a program.
05-22-2022, 01:34 AM (This post was last modified: 05-22-2022 01:38 AM by anyfoo.)
Post: #6
RE: Varying speed of a program.
(05-21-2022 11:47 PM)matalog Wrote:  I have not experienced programming languages that have different run-times in the same programs!

Oh, but there are plenty which do just by themselves. Anything with a JIT (the more dynamic the worse) or with a garbage collector, unless the start conditions are exactly the same. Even if they are or even if your language is entirely deterministic (say it's compiled C), modern operating systems will switch the core away from the current thread to whatever else needs running, and that is not deterministic. And even if that is not the case, interrupts and varying times to handle them still aren't deterministic and effectively introduce some "jitter". And a modern general purpose CPU will have caches and instruction pipelines that add onto that.

If you wanted to benchmark something on a C64 in the 80s, you already better took the average of multiple runs. Try on anything modern that isn't a simple microcontroller, and you have to make a lot of runs just to "warm up" the system to fill its caches and so on. (There are "real time" operating systems, but those mostly just give upper bound guarantees, not full determinism.)

The question is how significant the differences are, and whether it makes sense given e.g. the system's time slices for threads.

If you change your program to calculate, say, 5 times as much, does the absolute jitter stay the same or does it seem to scale with the amount of calculation it has to perform?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Varying speed of a program. - matalog - 05-21-2022, 09:46 AM
RE: Varying speed of a program. - albud44 - 05-21-2022, 10:02 AM
RE: Varying speed of a program. - Gene - 05-21-2022, 10:09 PM
RE: Varying speed of a program. - matalog - 05-21-2022, 05:01 PM
RE: Varying speed of a program. - matalog - 05-21-2022, 11:47 PM
RE: Varying speed of a program. - anyfoo - 05-22-2022 01:34 AM
RE: Varying speed of a program. - matalog - 05-24-2022, 08:43 PM



User(s) browsing this thread: 1 Guest(s)