Post Reply 
TI-84 Plus CE Python Benchmarking
08-26-2021, 02:28 PM (This post was last modified: 09-15-2021 07:47 AM by toml_12953.)
Post: #1
TI-84 Plus CE Python Benchmarking
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:
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))

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
08-27-2021, 03:13 PM (This post was last modified: 08-27-2021 05:02 PM by Xorand.)
Post: #2
RE: TI-84 Plus CE Python Benchmarking
Ran the same programs in my TI nspire CX II CAS.

Only changes to the programs were using clock() instead of monotonic() and not using format in the last statement of the benchmark (not supported function). Neither change affected the runtimes.

Green hat: 282.02 seconds

Benchmark (at 10000 iterations):
x = 0.8809818999686783
Performance index: 132295.71

I see that the 84 Python edition is still not available in the US. Wonder if the nspire having Python has anything to do with that?
Find all posts by this user
Quote this message in a reply
08-27-2021, 05:43 PM
Post: #3
RE: TI-84 Plus CE Python Benchmarking
(08-27-2021 03:13 PM)Xorand Wrote:  I see that the 84 Python edition is still not available in the US. Wonder if the nspire having Python has anything to do with that?

Check retail stores. I got my 84 Python at Target about a month ago, and I've seen it at other places like Meijer.
Visit this user's website Find all posts by this user
Quote this message in a reply
08-27-2021, 07:38 PM
Post: #4
RE: TI-84 Plus CE Python Benchmarking
(08-27-2021 03:13 PM)Xorand Wrote:  I see that the 84 Python edition is still not available in the US. Wonder if the nspire having Python has anything to do with that?

I'm in the US and I had no trouble getting one from a dealer in Florida.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
08-27-2021, 11:16 PM (This post was last modified: 08-27-2021 11:22 PM by toml_12953.)
Post: #5
RE: TI-84 Plus CE Python Benchmarking
(08-27-2021 03:13 PM)Xorand Wrote:  Only changes to the programs were using clock() instead of monotonic() and not using format in the last statement of the benchmark (not supported function). Neither change affected the runtimes.

The Nspire CX II CAS does support the format statement. It supports the format statement from an older Python version:

print("Runtime: %.2f seconds" %(t))

and it runs in 211.9 sec.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
08-28-2021, 01:49 AM
Post: #6
RE: TI-84 Plus CE Python Benchmarking
(08-26-2021 02:28 PM)toml_12953 Wrote:  Calculator Performance Index

I was told in the past (probably by a salesperson) that the "best" calculators balance power consumption and performance. Power consumption affects the size and weight to store the batteries to meet acceptable longevity of the unit before having to replace cells or recharge.

I'm curious if the power consumption to run this benchmark on each calculator will roughly average out or if there are bigger differences among calculators. If there are indeed significant differences in power consumption to run this benchmark (as my old friend the salesperson likes to argue), then what are the "best" calculators?

It would be VERY interesting to list the power consumption to run the benchmark for each calculator, i.e. Joule = benchmark time x peak Watt rating. Most calculators include the peak Watt rating in their specs or on the back panel, so I assume it should not be too difficult to get a rough "energy performance" measure accurate to at least 2 digits? Or has someone done this before?

I know of some remarkable calculators that never seem to need new cells despite frequent use. And no, these are not solar-powered units.

- Rob

"I can count on my friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
08-30-2021, 02:09 PM
Post: #7
RE: TI-84 Plus CE Python Benchmarking
(08-27-2021 05:43 PM)Dave Britten Wrote:  Check retail stores. I got my 84 Python at Target about a month ago, and I've seen it at other places like Meijer.

I had kinda looked when I passed the calculator shelves at Target but didn't see it in stock. Wasn't sure if they were here yet or not.
Find all posts by this user
Quote this message in a reply
08-30-2021, 03:22 PM
Post: #8
RE: TI-84 Plus CE Python Benchmarking
(08-30-2021 02:09 PM)Xorand Wrote:  
(08-27-2021 05:43 PM)Dave Britten Wrote:  Check retail stores. I got my 84 Python at Target about a month ago, and I've seen it at other places like Meijer.

I had kinda looked when I passed the calculator shelves at Target but didn't see it in stock. Wasn't sure if they were here yet or not.

You may need to check the back-to-school displays, if they're still set up. Chances are the additional new stock (i.e. the Python models) would have been placed there first. That was kind of what I noticed in the stores I checked.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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