08-26-2021, 02:28 PM
I just got a new TI-84 Plus CE Python calculator and, of course, I wanted to put it through its paces. My first benchmark is the green hat program I use for all new graphics devices. The source is shown below. It was very disappointing! It took over 40 minutes to run. HP Prime runs it in about 0.9 seconds!
Well, OK. This isn't a graphics speed demon.
Now I tested the math capabilities. Wow! it scored a Performance Index of 7149.42 on the benchmark from Calculator Performance Index
This is near the bottom of the table (lower is better). The Prime still beats it but not by too much compared to the graphics demo. I used the C version converted to Python. The source is also below.
Green Hat:
Benchmark:
Well, OK. This isn't a graphics speed demon.
Now I tested the math capabilities. Wow! it scored a Performance Index of 7149.42 on the benchmark from Calculator Performance Index
This is near the bottom of the table (lower is better). The Prime still beats it but not by too much compared to the graphics demo. I used the C version converted to Python. The source is also below.
Green Hat:
Code:
from math import *
from ti_system import *
import ti_plotlib as plt
from time import *
plt.window(0,319,0,199)
plt.pen("thick","solid")
for r in range(0,200,4)
plt.line(0,r,319,r,"")
plt.pen("thin","solid")
t0=monotonic()
p=160; q=100;
xp=144; xr=1.5*3.1415927
yp=56; yr=1; zp=64;
xf=xr/xp; yf=yp/yr; zf=xr/zp
for zi in range(-q,q):
if zi>=-zp and zi<=zp:
zt=zi*xp/zp; zz=zi
xl=int(.5+sqrt(xp*xp-zt*zt))
for xi in range(-xl,xl+1):
xt=sqrt(xi*xi+zt*zt)*xf; xx=xi
yy=(sin(xt)+.4*sin(3*xt))*yf
x1=xx+zz+p
y1=yy-zz+q
plt.color(0,255,0)
plt.plot(x1,y1,".")
if y1!=0:
plt.color(0,0,0)
plt.line(x1,y1-1,x1,0,"")
t=monotonic()-t0
disp_wait()
print("Runtime: ",t," seconds")
Benchmark:
Code:
from math import *
from time import *
def test():
t=monotonic()
loops=10000
for i in range(loops):
r0=10
while True:
x=r0
x+=1
x-=4.567E-4
x+=70
x-=69
x*=7
x/=11
r0-=1
if (r0<=0):
break
x=log(x)
x=sin(x)
x=sqrt(x)
x=sqrt(x)
print (x)
t=monotonic()-t
print ("Performance Index: {0:.2}".format(34/t*loops))