Speed Test

HPMike
Posts: 209
Joined: Fri Jul 21, 2017 11:01 pm
Location: DFW, Texas

Speed Test

Post by HPMike » Tue Oct 13, 2020 9:16 pm

I have run different versions of this speed test on many of my calculators. The DM41X coding is as follows:

LBL <t>SPEED
STO 10
TIME
HR
STO 00
0
STO 11
1
STO 12
LBL 01
ATAN
SIN
E^x
3
1/X
Y^x
ST+ 11
RCL 12
1
+
STO 12
DSE 10
GTO 01
TIME
HR
RCL 00
-
3600
*
END

To run, place a loop counter value in the X-register and XEQ SPEED

The result in the X-register is the elapsed time in seconds.

My result with 100 loops is 16.98 seconds

By comparison, the result on my DM42 with 100 loops is 0.70 seconds

So, the DM42 is about 24 times faster than the DM41X with this test.
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973.

User avatar
pcscote
Posts: 127
Joined: Tue May 02, 2017 12:12 pm
Location: Near Montréal, Québec, Canada

Re: Speed Test

Post by pcscote » Wed Oct 14, 2020 6:16 am

DM41X Results:

Code: Select all

FAST    =>  15.27 seconds
SLOW    => 187.10 seconds
41CL Results:

Code: Select all

TURBO50 =>   5.76 seconds
TURBO20 =>  11.36 seconds
TURBO10 =>  20.75 seconds
TURBO5  =>  39.61 seconds
TURBO2  =>  99.62 seconds
TURBOX  => 190.85 seconds
[DM1x/DM1xL/DM41/DM41L/DM41X/DM42]

grsbanks
Posts: 1021
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Speed Test

Post by grsbanks » Wed Oct 14, 2020 9:28 am

I have a benchmark program that looks like this:

Code: Select all

LBL "BMARK"
STO 98
CLX
SETSW
X<> 98
RUNSW
XEQ IND 99
STOPSW
SW
END
The idea is, you ASTO the name of the program to run in R99, set the stack up as you want it when entering the program to benchmark and then XEQ "BMARK". It'll go away and do it and when finished, the stack will be as your benchmarked program meant to leave it and the stopwatch will display the time taken to execute it.

I also use a summation based benchmark that does the same calculation:

Code: Select all

LBL "SUMM"
ABS
INT
X=0?
RTN
STO 01
3
1/x
0
LBL 01
RCL 01
ATAN
SIN
E^X
RCL Z
Y^X
+
DSE 01
GTO 01
END
Set the test run up with [Alpha] SUMM [Shift] ASTO 99 [Alpha]

Run the SUMM benchmark through BMARK for 100 iterations:

100 XEQ [Alpha] BMARK [Alpha]

00:00:12.21*R00
There are only 10 kinds of people in the world: those who understand binary and those who do not.

grsbanks
Posts: 1021
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Speed Test

Post by grsbanks » Wed Oct 14, 2020 9:30 am

HPMike wrote:
Tue Oct 13, 2020 9:16 pm
By comparison, the result on my DM42 with 100 loops is 0.70 seconds

So, the DM42 is about 24 times faster than the DM41X with this test.
Not entirely surprising given that the DM42 is running native code (Free42 compiled for the STM32 CPU) while the DM41X is an emulator running the 41CX ROM.
There are only 10 kinds of people in the world: those who understand binary and those who do not.

whuyse
Posts: 81
Joined: Thu Dec 21, 2017 1:23 pm

Re: Speed Test

Post by whuyse » Wed Oct 14, 2020 11:14 am

grsbanks wrote:
Wed Oct 14, 2020 9:28 am
I have a benchmark program that looks like this:

Code: Select all

LBL "BMARK"
STO 98
CLX
SETSW
X<> 98
RUNSW
XEQ IND 99
STOPSW
SW
END
Why not make it independent of numbered registers? Just put the name of the program in Alpha, set up the stack and XEQ"BMARK"

Code: Select all

LBL "BMARK"
SIGN
CLX
SETSW
X<> L
RUNSW
ASTO L
XEQ IND L
STOPSW
SW
END
Cheers, Werner
42S #3249S01123
DM42 #00345

grsbanks
Posts: 1021
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Speed Test

Post by grsbanks » Wed Oct 14, 2020 12:05 pm

whuyse wrote:
Wed Oct 14, 2020 11:14 am
Why not make it independent of numbered registers? Just put the name of the program in Alpha, set up the stack and XEQ"BMARK"
Because you can't benchmark a program that uses alpha data if you do that.

OK, you can't benchmark a program that expects data in R98 or R99 with my system, but that eventuality is far less probable than wanting to benchmark something that expects data in the alpha register. But full marks for backing up X in L using SIGN and LASTX and avoiding the use of R98 I hadn't thought of that and will alter my benchmarker accordingly.
There are only 10 kinds of people in the world: those who understand binary and those who do not.

HPMike
Posts: 209
Joined: Fri Jul 21, 2017 11:01 pm
Location: DFW, Texas

Re: Speed Test

Post by HPMike » Thu Oct 15, 2020 2:56 pm

grsbanks wrote:
Wed Oct 14, 2020 9:30 am
HPMike wrote:
Tue Oct 13, 2020 9:16 pm
By comparison, the result on my DM42 with 100 loops is 0.70 seconds

So, the DM42 is about 24 times faster than the DM41X with this test.
Not entirely surprising given that the DM42 is running native code (Free42 compiled for the STM32 CPU) while the DM41X is an emulator running the 41CX ROM.
The difference is even more dramatic if you run the DM41X in SLOW mode, the DM42 is almost 300 times faster !
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973.

dlachieze
Posts: 246
Joined: Thu May 04, 2017 12:20 pm
Location: France

Re: Speed Test

Post by dlachieze » Thu Oct 15, 2020 3:06 pm

This is the price to pay for the full 41 micro-code compatibility that allows you to use the large library of modules developed for he HP-41 ;)
DM42: 00425 - DM41X: β00066

User avatar
salvomic
Posts: 105
Joined: Sat Dec 30, 2017 10:09 am
Location: Ragusa, Sicily
Contact:

Re: Speed Test

Post by salvomic » Thu Oct 15, 2020 3:49 pm

HPMike wrote:
Thu Oct 15, 2020 2:56 pm
...

The difference is even more dramatic if you run the DM41X in SLOW mode, the DM42 is almost 300 times faster !
about this, I tested a short integral from an old thread in HP Museum:
in DM41X with Advantage module create a function FX:

Code: Select all

LBL "FX"
1
X<>Y
-
SQRT
1/X
END
then (accuracy 0.01)

Code: Select all

FIX 02
ALPHA: FX
0 ENTER 1
XEQ INTEG
Slow: 01:34:00
Fast: 00:08:26

In DM42 (accuracy 0.01):

Code: Select all

00 { 19-Byte Prgm }
01▸LBL "FX"
02 MVAR "X"
03 RCL "X"
04 +/-
05 1
06 +
07 SQRT
08 1/X
09 RTN
10 END
then

Code: Select all

∫f(x) -> LLIM 0 ULIM 1 ACC 0.01, ∫
DM42: less then 1s
DM42 (acc 0.001): 4s

:-)

But we already knew that.
∫aL√0mic (IT9CLU) :: DM42 (SN: 00881), DM41X (SN 00523), DM16, HP Prime, 50g, 41CX, 42s, 71b, 15C, 12C, 35s, WP34s -- Free42

HPMike
Posts: 209
Joined: Fri Jul 21, 2017 11:01 pm
Location: DFW, Texas

Re: Speed Test

Post by HPMike » Thu Oct 15, 2020 4:28 pm

dlachieze wrote:
Thu Oct 15, 2020 3:06 pm
This is the price to pay for the full 41 micro-code compatibility that allows you to use the large library of modules developed for he HP-41 ;)
Is this true for all modules, or only some ? From what I can tell, program POLY in module MATH works fine with the DM41X set to FAST mode.
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973.

Post Reply