![]() |
Python Speed - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Python Speed (/thread-16711.html) |
Python Speed - toml_12953 - 04-21-2021 07:34 AM The new Python interpreter graphics are fast! I ran three programs to draw a green hat, Here are the runtimes: HPPL: 7.793 sec CAS with Python syntax: 25.436 sec Python (Apr 16 Beta): 0.926 sec Here's the Python version: Code: #PYTHON EXPORT pyhat RE: Python Speed - robmio - 04-21-2021 12:05 PM Incredible! How was this speed test done? Did you use the emulator? Have you used the HP PRIME G2? RE: Python Speed - toml_12953 - 04-21-2021 01:46 PM (04-21-2021 12:05 PM)robmio Wrote: Incredible! How was this speed test done? Did you use the emulator? Have you used the HP PRIME G2? All times were measured on a G2. RE: Python Speed - robve - 04-21-2021 03:14 PM (04-21-2021 07:34 AM)toml_12953 Wrote: The new Python interpreter graphics are fast! Very nice. My PRIME G2 takes even a bit longer, about 8.2 seconds to run the HPPL program. I've used the following code, which I've translated to HPPL from the CAS Python code: Code: EXPORT pyhat() Not sure if the PRIME Python graphics library internals are any different. The Python interpreter presumably uses the hardware floating point support of the Cortex-A7. The fp performance of Python on the HP PRIME is incredibly good: https://tiplanet.org/forum/viewtopic.php?p=260518#HPPPY5 (translated in English with Google translate): "The HP Prime are really extraordinary in floating point calculation Python and the HP Prime G2 even crushes all competition with its omnipotence, even by doping the latter with overclocking! Both among the solutionsPython official and solutions Python compatible with exam mode, HP Prime G2 is clearly the most powerful either in integer or in floating point calculus, and by far, congratulations!" Even faster than "doping the competition with overclocking"... ![]() - Rob RE: Python Speed - Xorand - 04-21-2021 05:10 PM That's blindingly fast. As a point of comparison, I adapted your python program to run on my TI Nspire CX II CAS under its native python. The program took 215.98 seconds (yes, 3.5 minutes) to draw the hat. I optimized it slightly by doing all the drawing in a buffer and displaying the final product when done. That reduced time to 82.25 seconds. Looks like the HP Prime python is very well optimized. RE: Python Speed - toml_12953 - 04-22-2021 06:26 PM Changing Code: pixon(0,x1,230-y1,65280) to Code: pixon(0,x1,230-y1,eval("rgb(0,255,0)")) made the runtime go from 0.92 seconds to 4.37 seconds! RE: Python Speed - Guenter Schink - 04-22-2021 06:41 PM Although I think that the "Summation based benchmark for calculators " is of limited value, I thought I give it a try. Look here for the results - impressive. Günter |