HP Forums
Calculator graphics drawing benchmark - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not remotely HP Calculators (/forum-9.html)
+--- Thread: Calculator graphics drawing benchmark (/thread-17960.html)

Pages: 1 2 3


RE: Calculator graphics drawing benchmark - robve - 08-28-2023 11:57 AM

(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


RE: Calculator graphics drawing benchmark - StephenG1CMZ - 08-28-2023 10:12 PM

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)


RE: Calculator graphics drawing benchmark - robve - 08-29-2023 12:08 AM

(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


RE: Calculator graphics drawing benchmark - pier4r - 08-30-2023 08:23 PM

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.


RE: Calculator graphics drawing benchmark - arhtur - 09-09-2023 10:19 PM

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()



RE: Calculator graphics drawing benchmark - StephenG1CMZ - 09-10-2023 07:16 AM

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?