The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

48G vs 49G+ User RPL Speed Comparison
Message #1 Posted by John Colvin on 16 Nov 2013, 12:22 a.m.

Just for the heck of it, I ran a speed test of a simple user RPL program on my old 48G and on my not so old 49G+ calculators. The program simply calculates the factorial of a positive integer. I assumed that the 49G+ would execute faster than the 48G, but I was wrong. The 48G computed 250! in 6 seconds while the 49G+ took 15 seconds to compute 250! .

I could be wrong, but I read somewhere that the 49G+ uses an ARM processor that emulates the older Saturn processor for certain operations. This could account for the 49G+ slower speed in executing User RPL programs compared to the 48G. Anyone else have an idea why this speed difference exits?

Edited: 16 Nov 2013, 12:23 a.m.

      
Re: 48G vs 49G+ User RPL Speed Comparison
Message #2 Posted by Matt Kernal on 16 Nov 2013, 2:50 a.m.,
in response to message #1 by John Colvin

On the 49G+, try unchecking "Approx", found under MODE | CAS.

            
Re: 48G vs 49G+ User RPL Speed Comparison
Message #3 Posted by John Colvin on 16 Nov 2013, 5:49 p.m.,
in response to message #2 by Matt Kernal

I tried unchecking approximate mode and ran the program with a lower integer (50!) so that the result would fit on the stack. The execution time was even slower than in the approximate mode.

This article at HPcalc.org (http://www.hpcalc.org/hp49gplus.php) is where I read that the HP49G+ is using some kind of Saturn emulator running on an ARM 920T 32-bit 75 MHz processor. This makes sense for backward compatibility reasons. This would explain the slower speed for User RPL programs running on 49G+. I assume that built in math functions and graphing are handled directly by the ARM processor.

                  
Re: 48G vs 49G+ User RPL Speed Comparison
Message #4 Posted by Han on 23 Nov 2013, 11:49 a.m.,
in response to message #3 by John Colvin

Quote:
I tried unchecking approximate mode and ran the program with a lower integer (50!) so that the result would fit on the stack. The execution time was even slower than in the approximate mode.

This article at HPcalc.org (http://www.hpcalc.org/hp49gplus.php) is where I read that the HP49G+ is using some kind of Saturn emulator running on an ARM 920T 32-bit 75 MHz processor. This makes sense for backward compatibility reasons. This would explain the slower speed for User RPL programs running on 49G+. I assume that built in math functions and graphing are handled directly by the ARM processor.


That is not the reason for slower computation. In fact, the HP49G+ is generally much faster than the actual Saturn calculators. The reason 50! is slow on the HP49G+ is because there is a separate "exact" real number algorithm as opposed to the original non-exact real numbers.

When you unchecked approximate mode, you enabled the exact algorithm, which is slower. Try 50! vs 50.0! and you will see a huge difference in approximate mode.

                  
Re: 48G vs 49G+ User RPL Speed Comparison
Message #5 Posted by Mike Morrow on 23 Nov 2013, 5:32 p.m.,
in response to message #3 by John Colvin

Quote:
This would explain the slower speed for User RPL programs running on 49G+. I assume that built in math functions and graphing are handled directly by the ARM processor.

Almost all of the functions provided on the 49G+ and 50G are coded in the original Saturn language, which runs on the calculator's Saturn emulator, which runs on the ARM9. The overhead of the Saturn emulator and the function coding not being in native ARM9 is what makes the 49G+/50G much much slower (and thus, much more energy hungry) than had native ARM9 coding been used. Still, the 49G+/50G executes its functions typically two or three times faster than would a 48GX.

      
Re: 48G vs 49G+ User RPL Speed Comparison
Message #6 Posted by Kiyoshi Akima on 16 Nov 2013, 9:24 p.m.,
in response to message #1 by John Colvin

I don't have a 49 but my understanding is that the 50g is more-or-less the same hardware so I tried this on the 50g. It's also my understanding that in general the ARM emulating a Saturn is faster than the Saturn. But I've been known to be wrong...

With both Numeric and Approx checked, my UserRPL program approximated 250! as 3.2E492 in about 0.8 seconds. With both Numeric and Approx unchecked, the program generated a 493-digit integer in about 5.1 seconds.

My 48SX approximated it in about 19000 ticks while my 48GX did it in about 13000 ticks (2.3 and 1.6 seconds).

Here's the program I used:

<<
 1. DUP ROT FOR I
  I *
 NEXT
>>

For exact mode, remove the decimal point.

            
Re: 48G vs 49G+ User RPL Speed Comparison
Message #7 Posted by John Colvin on 17 Nov 2013, 2:13 a.m.,
in response to message #6 by Kiyoshi Akima

My factorial program: << -> c << WHILE c 1 > REPEAT c 1 - * 'c' DECR DROP END >> >>

With both numeric and approx. checked, the execution time on the 49G+ was ~10 seconds. An improvement, but still slower than the 48G. My ROM version is 2.15 (2009 release). It may be that the 50G is faster than the 49G+ ( A newer ROM version or faster ARM processor).

I don't mind the speed difference. If I want a program to run fast on my 49G+, I write it in System RPL.

      
Re: 48G vs 49G+ User RPL Speed Comparison
Message #8 Posted by Han on 16 Nov 2013, 10:07 p.m.,
in response to message #1 by John Colvin

Quote:
Just for the heck of it, I ran a speed test of a simple user RPL program on my old 48G and on my not so old 49G+ calculators. The program simply calculates the factorial of a positive integer. I assumed that the 49G+ would execute faster than the 48G, but I was wrong. The 48G computed 250! in 6 seconds while the 49G+ took 15 seconds to compute 250! .

I could be wrong, but I read somewhere that the 49G+ uses an ARM processor that emulates the older Saturn processor for certain operations. This could account for the 49G+ slower speed in executing User RPL programs compared to the 48G. Anyone else have an idea why this speed difference exits?


The introduction of "integer" object types for exact calculations from the 49G and onward is the reason you see any "slower" performance. The HP48 uses algorithms which take only "real" input types. On the 49G and later models, there are additional routines to handle "integer" inputs and these routines would run at the same speed or slower on the HP48. So if you are doing pure numerical calculations and integer solutions are unnecessary, make sure to have all real numbers ending in a decimal point (the auto-conversion itself can create a lot of overhead). That is, instead of 4 5 +, use 4. 5. +


[ Return to Index | Top of Index ]

Go back to the main exhibit hall