HP Forums
Plus42 for Windows - Why so slow? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: Plus42 for Windows - Why so slow? (/thread-17817.html)

Plus42 for Windows - Why so slow? - tommi60 - 12-14-2021 07:45 AM

00 { 15-Byte Prgm }
01 LBL "LOOP1"
02 LBL 01
03 1
04 +
05 GOTO 01

On my Windows machine (running Ryzen 5 5600G at 3.9GHz) I get
58,871,581 loops/min

The Binary version not that much higher, 62,634,378 loops/min

If I run the same bench on my lowly Android phone (with Snapdragon 780G), I get:
103,302,664 loops/min

And yes, POFF is selected.

Strange or not?

RE: Plus42 for Windows - Why so slow? - Thomas Okken - 12-14-2021 02:07 PM

Phones are pretty fast nowadays. Big Grin

Also, the Windows version is a 32-bit executable, while the Android version is a mixed 32-bit / 64-bit apk. If your phone has a 64-bit CPU (and I think by now they all do), that would give it an extra edge.

You could also try taking the time spent updating the display out of the equation, although it probably won't matter much: put an AVIEW or VIEW before your loop, so the display will remain static while the program is running.

RE: Plus42 for Windows - Why so slow? - tommi60 - 12-14-2021 04:51 PM

Adding an AVIEW before the loop boosted the result with 24% on the phone, but no effect on the desktop Smile)

Yes, I was aware that the Windows version is 32-bit executable, but I was still surprised with the huge difference.

RE: Plus42 for Windows - Why so slow? - Thomas Okken - 12-14-2021 05:21 PM

Another factor could be the overhead caused by checking for events while running programs. The Windows version calls PeekMessage() after every program step, while the Android version will just keep running for up to 10 ms before looking for events. The behavior on Android was motivated by the large overhead caused by the native-to-Java calls, and that performance optimization may have ended up making it more efficient than the Windows version.

At some point I figured program execution was Fast Enoughâ„¢ and stopped paying attention to these kinds of differences... If you want a real sense of the speed differences, throw some actual calculations into your loop, my prediction is that they will take up a lot more time than the overhead for fetching and executing program steps! (Not that that will help the Windows version, because the 32-bit thing makes even more of a difference while crunching numbers.)