HP Forums

Full Version: Calculator graphics drawing benchmark
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(08-28-2023 02:36 AM)Steve Simpkin Wrote: [ -> ]https://www.hpmuseum.org/forum/thread-20408.html

Oh wow, that is quick.

Thanks for sharing. I've added DM42 to the list. It ranks 2nd place (since HP Prime takes two top spots.)

Sorry I missed the earlier DM42 post, but this is even better! Glad arhtur found a faster way to draw Hitomezashi patterns on the DM42.

- Rob
DM42 ranks second place and prime takes top two places.

So that's prime 0th prime 1st and DM42 2nd.

Normally we start at 1st.
Update: Smile missing smiley (my keyboard was acting up)
(08-28-2023 10:12 PM)StephenG1CMZ Wrote: [ -> ]DM42 ranks second place and prime takes top two places.

So that's prime 0th prime 1st and DM42 2nd.

Normally we start at 1st.

Naturally (no pun intended), HP prime at 1 and 2 takes top two places, but it is the same machine. So effectively DM42 is 2nd (as a machine) as I was logically implying, but not literally and explicitly stating. Sigh...

Isn't that a fair statement? After all, 8 more programs for a HP Prime won't make the HP Prime run any faster (as a machine). Now, there is a difference between the G1 and G2, of course.

- Rob
Nice benchmark!

Regarding the "it is the same HW, only the languages are different". It makes a machine faster/slower. If someone has a choice one may go for a system for a certain task and for another system for another task. Sure using calcs is a bit of niche, but if one wants to have fun, why not. Effectively having different SW choices on the same HW makes the bundle (HW+SW) different for the user.
The Numworks graphing calculator, using the fill_rect() function in Python, has a possible 2nd place time - 0.308 seconds.

Because the Hitomezashi algorithm only uses horizontal and vertical lines, fill_rect() can be used, because horizontal and vertical lines are essentially flat rectangles.

I used the monotonic() function to measure the time consumed.

I had to add a sleep(0.25) delay before reading key presses at the end, because it seems that the program runs so quickly that when you press the OK key to run the program, if you're not quick enough, that same key press is read by the calculator to then display the start and finish times.

Code:
 
from kandinsky import *
from random import *
from time import *
from ion import *

colr=['white','black','red']

        

def hitomezashi():
  color(0,0,255)
  kolr=1
  while 1:
    s=int(input("s="))
      
    n=monotonic()
    for y in range(0,225,s):
      i=s*randint(0,1)
      for x in range(i,320,2*s):
        fill_rect(x,y,s,1,colr[1])
    for x in range(0,320,s):
      i=s*randint(0,1)
      for y in range(i,225,2*s):
        fill_rect(x,y,1,s,colr[1])
    k=monotonic()
    sleep(0.25)
    while 1:
      if keydown(KEY_OK):
        break
  print(n)
  print(k)
hitomezashi()
Numworks:
If you change KEY_OK to KEY_EXE that will run on the the Android emulation of Numworks too (which only detects KEY_EXE).
But I don't see any printed times.
It seems print(n) and print(k) are never executed as they follow a while 1:...
Indenting them seems to help?
Pages: 1 2 3
Reference URL's