Is there a standard way to measure performance?

Like a fake Z instruction or pattern (like a serial number of 999999 for Ozmoo maybe?) that can measure ticks / jiffies / milliseconds / whatever?

Obviously only interesting on older interpreters.

Here’s a story that finds all the prime numbers below 256. Could handle more than 256 but would really be better as a Z5 story since those implement bit shifts.

-Dave

sieve.z3 (1.2 KB)

Note this is not written in Inform or ZIL but could presumably be trivially translated into either.

sieve.txt (511 Bytes)

1 Like

Rename it to something ending it .txt

2 Likes

Complete a play through of Adventure. Or Counterfeit Monkey for Glulx.

Yeah, I guess that would be best. It’s going to count a lot of time in your screen display routines but… why not, that’s pretty much what text adventures do all day and you care about its speed.

But I meant more like a standard way to signal to an interpreter you’d like to measure how long a certain following code sequence (Sieve, Adventure, Zork I) takes to execute.

-Dave

This may not be exactly what you asked for, but Ozmoo can be made to write the two lowest bytes of the jiffy clock into the Z-machine header every instruction.

On line 98 in make.rb, uncommment this line:

#	'TIMING', # Store the lowest word of the jiffy clock in 0-->2 in the Z-code header

A jiffy is 1/60s on C64.

I use this to evaulate the performance of code in PunyInform.

1 Like

There are a lot of copies of Adventure lying around. Do any of them come with a reference walkthrough? The one I’m aware of is in jeffnyman/zifmia.

There are walkthroughs for PunyInform Adventure and Inform 6 Adventure in the Ozmoo distribution.

If you build Ozmoo with -bm (i.e.“benchmark”), it will incorporate the walkthrough in the interpreter, rig the PRNG, disable MORE prompts, and it will print the jiffy clock before the first move, as well as after the last move.

1 Like

To be clear, 0 - - > 2 is the word at address 4, right?

Yes, it’s the same as 4-->0

I have the script in Inform6-Testing/reg/Advent-z.reg at master · erkyrath/Inform6-Testing · GitHub . Note that it’s for advent.inf r5 s961209, which is not the latest version, and it assumes the PRNG option used by Bocfel.

sieve.z3 (1.3 KB)

sieve.txt (655 Bytes)

1 Like

Ohh. Zoom added some unofficial opcodes to start and stop a timer. Bocfel also supports them (though the most recent release of Gargoyle dropped support), but they’re otherwise not widely supported so you’d be limited to those interpreters.

1 Like