Post Reply 
Calculator graphics drawing benchmark
01-31-2022, 07:49 PM
Post: #32
RE: Calculator graphics drawing benchmark
(01-29-2022 06:08 PM)robve Wrote:  Don't want to be a PitA, but sprite drawing is different and isn't benchmarked. Still, I feel strongly that this method should be included in the performance table somehow, but perhaps in a separate benchmark table that allows memory copy/sprite/blitting operations to speed up line drawing (per line) for all calculators that support such features. That's just my opinion, not sure what others think is most fair?

Did you ask for it? Smile

Here is the performance index of over 38 millions on a Prime G2 Python with blitting
Code:
from hpprime import *
from urandom import *
 
def hitomezashi():
    color=255
    eval('PRINT')
    s=int(input("s = "));print(s)
    eTime=eval('time')
    loop0=100
    loop=loop0
    while loop >0:
      fillrect(0,0,0,320,240,0xffffff,0xffffff)

      dimgrob(1,320,1,0xffffff)            
      for x in range(0,320,2*s):
         line(1,x,0,x+s,0,color) 

      dimgrob(2,1,240,0xffffff)
      for y in range(0,240,2*s):
         line(2,0,y,0,y+s,color)
                   
      for y in range(0,240,s):
        i=s*randint(0,1)
        blit(0,i,y,1)      
      for x in range(0,320,s):
        i=s*randint(0,1)
        blit(0,x,i,2)
#        eval("Wait(.03)")
      loop=loop-1
      
    eTime=(eval('time')-eTime)/loop0      
    eval("WAIT")
    print("Loops  = ",loop0)
    print("Time per loop =\n {:,} sec".format(round(eTime,12)))
    performance=round(320*240/eTime)
    print("Performance =\n {:,d} ".format(performance))   
 
hitomezashi()

s = 4
320*240 Pixels
Loops = 100
Time per loop 0.00197 sec
Performance Index: 38,984,772

Still not ready for Python on the Prime? Wink

Günter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Calculator graphics drawing benchmark - Guenter Schink - 01-31-2022 07:49 PM



User(s) browsing this thread: 16 Guest(s)