It's extremely easy to measure.
ZXNet echo conference «code.zx»
From Valery Grigoriev → To All 21 August 2006
Hello, rasmer
You take a program like -
1 LET A=A+1; GOTO; 1
99 LET A=1; GOTO; 1
You run this (using RUN 99) for, say, 10 minutes (timed by
timer). You stop. Look A. Divide [10 (minutes)*60 (seconds)*50
(frames)*69998 or 71998 (depending on the model)] by the resulting number. Here
you will have an almost exact number of cycles per cycle of the form LET A=A+1; GOTO; XXX
Next, you complicate it to look like this:
1 : LET A=A+1; GOTO; 1
99 LET A=1; GOTO; 1
Since you already know how many clock cycles the previous construction takes in clock cycles,
then you can calculate the size in measures (as was the paragraph above) of the new
designs. Subtract from the resulting number of cycles for the current design then
the number that was received earlier. This will be almost the number of cycles that
occupied by your team in the bass - .
What this approach does not take into account: the fact is that the BASIC translator, to put it mildly
he is stupid, and he looks for every line from the first. Therefore - in order to reduce these
costs - the launch starts from line 99, which makes the transition to the first - the most
a quick line, but he still has to look for even the first line.
In addition, you will definitely have costs for switching from operator to
operator inside the line, which is generally difficult to take into account.
You can get a more accurate result only if you analyze the workmachine code processing bass commands, and even then it will be strong
depend on what the initial conditions were. Those. conditional statements can
work faster slower depending on the initial conditions - I think here
You don’t even need to explain why.