Post Reply 
HP Prime: a student's view
08-30-2021, 12:47 PM (This post was last modified: 08-30-2021 02:46 PM by toml_12953.)
Post: #3
RE: HP Prime: a student's view
(08-30-2021 01:11 AM)Liam Hays Wrote:  [*]Why is Python so fast, compared to PPL? For reference, I ran the thimet.de Performance Index in PPL and Python. PPL scored about 27,200, and Python scored a little over 490,000. That's a factor of 18 times faster in Python.

One HP guru told me that HPPL runs under a type of virtual machine. Python runs directly on the processor.

I ran a Python translation of the C program on that site on a TI-84 Plus CE Python and got an index of 2302.74. Not bad for a cheap school calculator.
Here's what I ran:
Code:
from math import *
from time import *
t=monotonic()
loops=1000
for i in range(0,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("Index: {0:.2f}".format(34/t*loops))

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP Prime: a student's view - Liam Hays - 08-30-2021, 01:11 AM
RE: HP Prime: a student's view - toml_12953 - 08-30-2021 12:47 PM
RE: HP Prime: a student's view - Liam Hays - 08-31-2021, 01:30 AM
RE: HP Prime: a student's view - parisse - 08-31-2021, 07:30 PM
RE: HP Prime: a student's view - Liam Hays - 08-31-2021, 11:20 PM
RE: HP Prime: a student's view - jte - 09-01-2021, 10:43 PM
RE: HP Prime: a student's view - Liam Hays - 09-03-2021, 01:31 AM
RE: HP Prime: a student's view - jte - 09-05-2021, 03:44 PM
RE: HP Prime: a student's view - jte - 09-05-2021, 06:16 AM
RE: HP Prime: a student's view - pinkman - 09-03-2021, 09:30 PM
RE: HP Prime: a student's view - Liam Hays - 09-04-2021, 01:30 AM
RE: HP Prime: a student's view - Liam Hays - 09-04-2021, 04:49 PM
RE: HP Prime: a student's view - ijabbott - 09-04-2021, 08:44 AM



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