The display is slowing stuff down
More surprises. I rewrote the python program to do the same thing as my awk program. It writes to a pbm image file instead of to the screen. My unoptimised awk program took less time than my new python program, which was also unoptimised.
0.123 seconds - awk
0.139 seconds - python writing to a file
12 minutes 39.687 seconds - python writing to the screen
So my earlier python program was spending almost all its time in the graphics routines.
I wonder if it's possible to find a simpler, faster way to write to a screen. One of the things old computers did really well was writing directly to the screen. Unfortunately, extra capabilities of modern computers require extra calculations that slow everything down -- being able to write to an arbitrarily sized and positioned window, for example. If you have extra layers of a language to interpret graphical commands this further slows everything.
0.123 seconds - awk
0.139 seconds - python writing to a file
12 minutes 39.687 seconds - python writing to the screen
So my earlier python program was spending almost all its time in the graphics routines.
I wonder if it's possible to find a simpler, faster way to write to a screen. One of the things old computers did really well was writing directly to the screen. Unfortunately, extra capabilities of modern computers require extra calculations that slow everything down -- being able to write to an arbitrarily sized and positioned window, for example. If you have extra layers of a language to interpret graphical commands this further slows everything.