The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Speed comparison WP34S and other HPs
Message #1 Posted by Harald on 17 Mar 2012, 8:28 p.m.

I was amazed by the speed of the WP34S, so I decided to write a litte program to compare its speed to my other calculators. The Program simply adds all integers from the entered number down to 1 and displays the result. Because some calculators have no loop control and others lack the x=0? test, I wrote a few different versions. This isn't the most scientific aproach to this, but I thought I'd share it anyway. If you feel like it you could also add execution times for the calculators I couldn't test because I simply don't own an example.

Program 1:
001 LBL A
002 STO 00
003 1
004 STO-00
005 R down
006 RCL 00
007 x=0?
008 Skip 002
009 +
010 back 007
011 R down
012 RTN
Used on WP34S, takes about 2 seconds to add all the numebrs up to 1000, 13seconds for 10000

Slightly different version without the skip and back branching of the 34S:

001 LBL A
002 STO 00
003 LBL 1
004 1
005 STO-00
006 R down
007 RCL 00
008 x=0?
009 GTO 0
010 +
011 GTO 1
012 LBL 0
013 R down
014 RTN

HP-15C (original) add up to 100: 1min 4sec HP-15C LE add up to 1000: 4sec add up to 10000: 39sec HP-42S add up to 100: 10sec add up to 1000: 1min 44sec HP-33s add up to 1000: 19sec HP-35s add up to 1000: 1min 3sec HP-32SII add up to 1000: 37sec HP-41CV add up to 100: 23sec add up to 1000: 3min 50sec HP-29C add up to 100: 38sec add up to 1000: 6min 25sec

Remove the Labels for the 12C and 25: 01 STO 00 02 1 03 STO-00 04 R down 05 RCL 00 06 x=0? 07 GTO 10 08 + 09 GTO 02 10 R down

HP-12c old 3xLR44 type: add up to 100: 42sec HP-12c new 1xCR2032 type: add up to 100: 40sec HP-25: add up t0 100: 38sec add up to 1000: 6min 25sec

Program 2 01 LBL 02 A 03 STO 8 04 0 05 LBL 06 0 07 RCL 8 08 + 09 g 10 DSZ 11 GTO 12 0 13 RTN

HP-65: add up to 100: 21sec add up to 1000: 3 min 43sec

Same program looks like this on the 29C: 01 LBL 1 02 STO 0 03 0 04 LBL 0 05 RCL 0 06 + 07 DSZ 08 GTO 0 09 RTN

HP-29C: add up to 100: 26sec add up to 1000: 4min 26sec WP-34S: add up to 1000: 1sec add up to 10000: 9sec

Conclusions:

Program 1 is (as expected) slower than program 2. From the calculators I ran both programs on, I worked out that it takes about 1.45 times as long as program 2. Also (and also as expected) the execution time is roughly proportional to the input number. With that information in mind I came up with the following execution time index:

WP-34S: 1 HP-15C LE: 3 HP-33S: 15 HP-32SII: 28 HP-35S: 48 HP-42S: 78 HP-41CV: 176 HP-65: 248 HP-29C: 295 HP-25: 295 HP-12C CR2032:307 HP-12C LR44: 322 HP-15C (old): 490

Comments? Corrections? Additions?

Cheers, Harald

      
Re: Speed comparison WP34S and other HPs
Message #2 Posted by Paul Dale on 17 Mar 2012, 8:54 p.m.,
in response to message #1 by Harald

How about:

001: LBL A
002: # 000
003: RCL+ 00
004: DSZ 00
005: BACK 002
006: RTN

And the results in seconds are:

    mode    type      1,000    10,000
    FAST    real        0.6       5.6
    FAST    integer     0.5       4.9
    SLOW    real        0.8       8.9
    SLOW    integer     0.7       7.5

This was with fresh batteries (my first change in my test unit). With old batteries, the timings were more like the SLOW regardless of mode.

An even more compact solution:

001: LBL A
002: #000
003: RCL+ Y
004: DSZ Y
005: BACK 002
006: RTN

I'd expect the timing to be the same however.

- Pauli

      
Re: Speed comparison WP34S and other HPs
Message #3 Posted by Paul Dale on 17 Mar 2012, 8:57 p.m.,
in response to message #1 by Harald

Then there is the clever/cheats' method:

001: LBL A
002: ENTER[^]
003: INC X
004: [times]
005: # 002
006: /
007: RTN

or in integer mode, we can save a step:

001: LBL A
002: ENTER[^]
003: INC X
004: [times]
005: SR 01
006: RTN

The run time for either is essentially zero.

- Pauli

            
Re: Speed comparison WP34S and other HPs
Message #4 Posted by Harald on 17 Mar 2012, 9:12 p.m.,
in response to message #3 by Paul Dale

Uhm, yes. That wasn't quite the point of the exercise ;)

About your first post. Neat little porgram. I thought about using RCL+. But then wasn't quite sure if all the calculators supported register arithmetic on RCL as well as STO. And since I only wanted to compare them, I didn't bother looking that up.

      
Re: Speed comparison WP34S and other HPs
Message #5 Posted by Paul Dale on 17 Mar 2012, 8:58 p.m.,
in response to message #1 by Harald

I'll also note that, even though it is faster at basic arithmetic, the WP 34S is slower than the 15C LE for some of the transcendental functions.

- Pauli

            
Re: Speed comparison WP34S and other HPs
Message #6 Posted by Harald on 17 Mar 2012, 9:15 p.m.,
in response to message #5 by Paul Dale

Is that because they put more emphasis on fast execution rather then accuracy when they designed the algorithms for the 15C?

I should probably use some more complex functions in the test program and then compare the results again.

Edited: 17 Mar 2012, 9:17 p.m.

                  
Re: Speed comparison WP34S and other HPs
Message #7 Posted by Paul Dale on 17 Mar 2012, 9:38 p.m.,
in response to message #6 by Harald

No, the 15C's algorithms are first rate accuracy wise. The 34S is carrying 39 digits internally as opposed to 10/13 for the 15C. I also haven't attempted to optimise much of the 34S code base for speed -- accuracy and space have been our primary concerns.

- Pauli

                        
Re: Speed comparison WP34S and other HPs
Message #8 Posted by bill platt on 17 Mar 2012, 10:39 p.m.,
in response to message #7 by Paul Dale

"accuracy and space have been our primary concerns."

As it should be :-)

      
Re: Speed comparison WP34S and other HPs
Message #9 Posted by Dominic Richens on 18 Mar 2012, 7:40 a.m.,
in response to message #1 by Harald

How about adding some of the modern RPL calculators for comparison? I have an HP-48SX at work I can test on Monday.

Also interesting would be programs that use transcendental functions, one that compares the speed of numeric integration and the solver, for calculators that have those.

I remember using the solver or integration function on my (now lost) HP-15C meant staring at a screen flashing "Running" for a while. On the WP34s the answer is nearly instant!

            
Re: Speed comparison WP34S and other HPs
Message #10 Posted by Harald on 18 Mar 2012, 9:00 a.m.,
in response to message #9 by Dominic Richens

I've never really warmed up to RPL programing. I could test on the 48S, SX and GX, the 28C and S and the 49gII. Maybe I'll write the program for those too.

I agree, timing for advanced functions would be intresting. Any suggestions on what to calculate? Integration and solver would very much limit the number of calculators it can run on though.

Harald

      
Re: Speed comparison WP34S and other HPs
Message #11 Posted by Craig Ruff on 18 Mar 2012, 11:01 a.m.,
in response to message #1 by Harald

41CL (TURBO50)
to   100     1s
to  1000    13s
to 10000 2m  9s

48SX to 100 0.93s to 1000 9.3s to 10000 1m 43s

50g to 100 0.53s to 1000 5.2s to 10000 53s

Quick attempt for RPL program including measuring the timing:

<< TICKS 0 ROT 1 FOR I I + -1 STEP TICKS 3 ROLL - B->R 8192 / >>

Edited: 18 Mar 2012, 11:02 a.m.

            
Re: Speed comparison WP34S and other HPs
Message #12 Posted by Donald Williams on 18 Mar 2012, 11:51 a.m.,
in response to message #11 by Craig Ruff

You might be interested in this info

Edited: 18 Mar 2012, 11:52 a.m.

                  
Re: Speed comparison WP34S and other HPs
Message #13 Posted by pascal_meheut on 18 Mar 2012, 12:53 p.m.,
in response to message #12 by Donald Williams

Seem strange to compare normal programs with compiled C code that do cannot be stopped...

                        
Re: Speed comparison WP34S and other HPs
Message #14 Posted by Donald Williams on 18 Mar 2012, 6:57 p.m.,
in response to message #13 by pascal_meheut

By adjusting the conditions of the while loop it will stop in exactly 60 seconds.

All these first few benchmarks only demonstrate the raw speed of the underlying hardware. Nonetheless there is a lesson in all that. When you compare the same device speed in their native programming environment they are not quite so impressive. So you can start off with the best and end up with the mediocre. Right.

In fact if this comparison means anything (questionable?), the calculator "speed freaks" should be investing their money on a vintage 1984 HP-71B. A fine machine I might add.

            
Re: Speed comparison WP34S and other HPs
Message #15 Posted by Gilles Carpentier on 18 Mar 2012, 3:51 p.m.,
in response to message #11 by Craig Ruff

You can use TEVAL and the ad hoc function (Sigma) with HP50G :

TEVAL Type: Function Description: For the specified operation, performs the same function as EVAL, and returns the time taken to perform the evaluation as well as the result.

Replace &sum; with Sigma greek character :

<< '&sum;(x=1,1000,x)' EVAL >>
TEVAL

500500 s:0.5833

<< '&sum;(x=1,10000,x)' EVAL >> TEVAL

50005000 s:.5834

(?!?) quite no difference !

<< '&sum;(x=1,100000,x)' EVAL >> TEVAL

5000050000 s:.59

Seems incredible but

<< '&sum;(x=1,10000000,x)' EVAL >> TEVAL

take quite the same time on a real HP50G calc but is much slower on Emu48.

what is this mistery ?!?

Edit : 1 to 1E100 sum give the exact 200 digits answer in less than 0.6 seconds on a real 50G (not on Emu48)

Curiously '&sum;(x=1,100000,x)' TEVAL dont't work. Looks like a bug

Edited: 18 Mar 2012, 4:54 p.m. after one or more responses were posted

                  
Re: Speed comparison WP34S and other HPs
Message #16 Posted by Harald on 18 Mar 2012, 4:12 p.m.,
in response to message #15 by Gilles Carpentier

I suspect it doesn't simply add the numbers, but finds an algebraic solution and then evaluates that.

                        
Re: Speed comparison WP34S and other HPs
Message #17 Posted by Gilles Carpentier on 18 Mar 2012, 4:17 p.m.,
in response to message #16 by Harald

Or some 'embedded ARM' piece of software ?

With the same rom version,emu48 is much much slower.... And Emu48 knows nothing about ARM on the contrary of HP50G. And i remember that the ROM includes some acceleration process for native ARM device

Edited: 18 Mar 2012, 4:39 p.m.

      
Re: Speed comparison WP34S and other HPs
Message #18 Posted by Tom Grydeland on 19 Mar 2012, 4:52 a.m.,
in response to message #1 by Harald

On the HP-42S (with no DSZ) we can use DSE instead, and accept a +0 or two for the sake of brevity:

00 { 18-Byte Prgm }
01 LBL "SUM"
02 0
03 X<>Y
04 LBL 00
05 STO+ ST Y
06 DSE ST X
07 GTO 00
08 +              ; instead of Rv, with less stack corruption
09 END

Computes up to 1000 in 63s on my 42S.

            
Re: Speed comparison WP34S and other HPs
Message #19 Posted by Tom Grydeland on 19 Mar 2012, 5:58 a.m.,
in response to message #18 by Tom Grydeland

And for the 15C(LE) with no DSE on stack registers, we need one numbered register for the equivalent program:

000 LBL B   ; 42,21,12
001 STO 0   ; 44 0
002 DSE 0   ; 42, 5, 0
004 LBL 1   ; 42,21, 1
005 RCL+ 0  ; 45,40, 0
006 DSE 0   ; 42, 5, 0
007 GTO 1   ; 22 1
008 RTN     ; 43 32
On my 15C, this sums to 100 in about 52s, while my 15CLE sums up to 10000 in just over 31s.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall