Calculator graphics drawing benchmark
08-28-2023, 11:57 AM
Post: #41
 robve Senior Member Posts: 458 Joined: Sep 2020
RE: Calculator graphics drawing benchmark
(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

"I count on old friends to remain rational"
08-28-2023, 10:12 PM (This post was last modified: 08-29-2023 01:20 PM by StephenG1CMZ.)
Post: #42
 StephenG1CMZ Senior Member Posts: 1,033 Joined: May 2015
RE: Calculator graphics drawing benchmark
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: missing smiley (my keyboard was acting up)

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
08-29-2023, 12:08 AM
Post: #43
 robve Senior Member Posts: 458 Joined: Sep 2020
RE: Calculator graphics drawing benchmark
(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

"I count on old friends to remain rational"
08-30-2023, 08:23 PM
Post: #44
 pier4r Senior Member Posts: 2,248 Joined: Nov 2014
RE: Calculator graphics drawing benchmark
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.

Wikis are great, Contribute :)
09-09-2023, 10:19 PM
Post: #45
 arhtur Junior Member Posts: 25 Joined: Jun 2021
RE: Calculator graphics drawing benchmark
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()
09-10-2023, 07:16 AM (This post was last modified: 09-10-2023 07:35 AM by StephenG1CMZ.)
Post: #46
 StephenG1CMZ Senior Member Posts: 1,033 Joined: May 2015
RE: Calculator graphics drawing benchmark
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?

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
 « Next Oldest | Next Newest »