Hi all!

I recently moved the data about the historical "Calculator add loop" benchmark (on the hpmuseum) on a wiki page, here: http://www.wiki4hp.com/doku.php?id=benchmarks:addloop .

Since the benchmark, originally, was not updated after 2011, i searched for new results and i found that no one has done it with TI last calculators plus some TI calculators don't use the "for" statement and for this reason are slow. (The Ti89 is way slower than Hp50g while they should be almost on the same level)

So, is anyone willing to do this benchmark and report the results in this topic?

Ideally we need result for: Ti nspire models (first and later ones), Ti89/Voyage 200, new TI-8X

The format is:
- Calculator used and firmware/software
- The count after 60 seconds of execution
- The program code used.

The pseudocode is:

Code:

Do a summation as fast as you can for 60 seconds.
Like:
sum:=0; While (true) { sum++ }


For further comparisons there is another benchmark (just designed): http://www.wiki4hp.com/doku.php?id=benchmarks:middlesquare . Even for this any result will be appreciated.

Thanks a lot and sorry if the section is not the "right one" Smile


Code:



edit: the community has just demanded a simpler benchmark (the middle square one seems not so clear). Do you mind to run also this: http://www.wiki4hp.com/doku.php?id=benchmarks:ultranaiveprimes ?

The code is:

Code:

input: n
--
for k:=3 to n do {
  for j:=2 to k-1 do {
        if ( k mod j == 0 ) then {
          j:= k-1 //so we exit from the inner for
        }
  }
}


The result format is:

Code:

A result is composed by the following list
- the device used plus the language used, eventual overclock, eventual custom firmware and so on.
- time elapsed for a given n in seconds (see below)
- the code used.

if the calculator is too slow, or limited, to compute a given n, then report "for n the computation
takes too much time". Conversely, if the calculator is too fast to compute a given n, then report
"for n the computation takes too little time, i skipped it"


The options are

Code:

n:= 100
n:= 1000
For very fast implementations:
n:= 10000
n:= 100000
You found the right place, pier4r, and welcome to Cemetech! If no one else gets around to benchmarking the TI-84 Plus C Silver Edition, I can do that. I'm not sure that the TI-"BASIC" on the TI-Nspire is powerful enough to run that MiddleSquare benchmark, but it can certainly do the summation one. My bigger problem is that I don't think the summation benchmark is really a fair comparison of a language's speed, just the speed at which it can parse new commands and increment a variable. Since you have numbers for plenty of other devices there, though, it would at least be a rough comparison, I suppose.
KermMartian wrote:
You found the right place, pier4r, and welcome to Cemetech! If no one else gets around to benchmarking the TI-84 Plus C Silver Edition, I can do that. I'm not sure that the TI-"BASIC" on the TI-Nspire is powerful enough to run that MiddleSquare benchmark, but it can certainly do the summation one.

Thanks, the middle square one seems hard but it is simple (even if it has for target high end graphing calculators with rounding functions). Anyway we just designed a new one, simpler, since some simpler, but programmable, calculators don't have function like "floor", "ceiling" and so on.

PS: the nspire should be quite powerful! see http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=700 (it's a complete bench, but some implementations are too fast for it)


Code:

1:44         TI-89 Titanium    Formula / List / HW3
1:31         ClassPad 300+     Formula / List / OS 2.2 / Fast Mode x1.4 (29.5->59 MHz)
1:30         HP-50G            UserRPL
1:29         TI-Nspire         Formula / List / TI-84+ Keypad / OS 3.0
1:08         TI-84+            Formula / List
1:07         HP-50G            UserRPL / Fast Mode x1.3 (75->203 MHz)
53.1       TI-89             Formula / List / HW2 / Turbo x2.0
19.5       TI-81             Formula / Statistic List / Ver.1.6K / Turbo x2.5
9.07      FX-9860G SD       Formula / Matrix / OS 1.0 / Fast Mode x1.9 (29.5->118 MHz)
7.5       TI-Nspire         Formula / List / OS 1.2
1.32      HP-39GII          Formula / List
1.10      ClassPad 300+     CPLua 0.8 / Bytecode
0.0445    TI-Nspire CX CAS  Lua / Bytecode / OS 3.1
0.0255    TI-89             TIGCC 4.1.2 / Structured / Cross Compiler / HW2
0.00613   HP-50G            HPGCC 3.0 / RegVars / Cross Compiler / Slow Mode x12.7 (75->6.0 MHz)


6 milliseconds are almost nothing for measurements Sad

Quote:
My bigger problem is that I don't think the summation benchmark is really a fair comparison of a language's speed, just the speed at which it can parse new commands and increment a variable.

I agree on that, it is more a comparison of the entire device with hardware, software (OS/languages) and even right choose of functions. But it gives an idea!



edit: for further comparisons, all the benchmark gathered on the wiki are here
http://www.wiki4hp.com/doku.php?id=benchmarks:addloop&do=index
A little up! Casio guys are on rampage! (check the wiki pages)

We need some results from TI guys!
Some initial results from my TI-89 Titanium:

TI-89 Titanium (HW 4, AMS 3.10)
In AUTO mode: 9104.33 (avg. of 3 trials)
In EXACT mode: 9504 (avg. of 3 trials)
In APPROX mode: 6838.67 (avg. of 3 trials)
Code (entered directly on Home Screen): 0→x:Loop:x+1→x:EndLoop

More results with my regular TI-89 (which I expect to be about the same) and with other types of loops, and a look at the other algorithm you mentioned are planned as I have time.
Thanks a lot!

I'll wait Smile
I reran the TI-89t tests because there are evidently more variables influencing the benchmark results than I realized. The last test was in a folder with various variables in it and other stuff on the home screen. I did the test again from an empty folder and a completely cleared home screen and got these results:

TI-89 Titanium (HW 4, AMS 3.10, patched with tiosmod/amspatch)
In AUTO mode: 12372.33 avg.
In EXACT mode: 12335.33 avg.
In APPROX mode: 8591.33 avg.
Code (entered directly on clear Home Screen from empty folder):
0→x:Loop:x+1→x:EndLoop

TI-89 Titanium (HW 4, AMS 3.10, patched with tiosmod/amspatch)
In AUTO mode: 12655.33 avg.
In EXACT mode: 12649.67 avg.
In APPROX mode: 4958.33 avg.
Code (entered directly on clear Home Screen from empty folder):
For x,1,9999999999:EndFor

TI-89 Titanium (HW 4, AMS 3.10, patched with tiosmod/amspatch)
In AUTO mode: 12133 avg.
In EXACT mode: 12149.33 avg.
In APPROX mode: 8571.33 avg.
Code (entered directly on clear Home Screen from empty folder):
0→x:While true:x+1→x:EndWhile

TI-89 Titanium (HW 4, AMS 3.10, patched with tiosmod/amspatch)
In AUTO mode: 11072.33 avg.
In EXACT mode: 11075 avg.
In APPROX mode: 8081.33 avg.
Code (entered directly on clear Home Screen from empty folder):
0→x:Lbl a:x+1→x:Goto a

(The OS was also patched in the last post; I forgot to mention it. I don't know if the patch has a significant impact on the benchmark results.)

TI-89 (HW 2, AMS 2.08, patched with tiosmod/amspatch)
In AUTO mode: 11428.33 avg.
In EXACT mode: 11436 avg.
In APPROX mode: 8156 avg.
Code (entered directly on clear Home Screen from empty folder):
0→x:Loop:x+1→x:EndLoop

TI-89 (HW 2, AMS 2.08, patched with tiosmod/amspatch)
In AUTO mode: 10666.33 avg.
In EXACT mode: 10692.67 avg.
In APPROX mode: 4295 avg.
Code (entered directly on clear Home Screen from empty folder):
For x,1,9999999999:EndFor

TI-89 (HW 2, AMS 2.08, patched with tiosmod/amspatch)
In AUTO mode: 11174.33 avg.
In EXACT mode: 11185.67 avg.
In APPROX mode: 8019.67 avg.
Code (entered directly on clear Home Screen from empty folder):
0→x:While true:x+1→x:EndWhile

TI-89 (HW 2, AMS 2.08, patched with tiosmod/amspatch)
In AUTO mode: 10266 avg.
In EXACT mode: 10254.33 avg.
In APPROX mode: 7521.67 avg.
Code (entered directly on clear Home Screen from empty folder):
0→x:Lbl a:x+1→x:Goto a
Whoa! What a great work! Thanks!

Anyway it baffles me that the Ti89 can't be faster as mush as the Hp50g with userRPL :/ (nor faster as much as other TI-8X).
Quote:
(The OS was also patched in the last post; I forgot to mention it. I don't know if the patch has a significant impact on the benchmark results.)

Nope, my tiosmod+amspatch hardly makes a difference on such benchmarks. I fiddled with the HeapDeref ROM_CALL, but not with its inlined versions scattered in the code base...

Quote:
Anyway it baffles me that the Ti89 can't be faster as mush as the Hp50g with userRPL :/ (nor faster as much as other TI-8X).

The speed difference with the HP-50g can be trivially explained Wink
1) the raw speed of the 89 is much lower than that of the 49G+ and its offspring, to begin with. On the one hand, the 68000 (CISC) is clocked at 12 MHz, and every instruction takes at least 4 clock cycles, so the TI-68k series is made of 1-2 MIPS machines; on the other hand, on ARM (RISC) processors, instructions take 1 or 2 clock cycles, so the 49G+ and offspring are >30 MIPS machines.
2) TI's BASIC implementation is not very optimized.

For TI-68k/AMS/BASIC, it could be interesting to evaluate the speed with local variables ?


I have posted a pair of C benchmarks on TI-Planet, one being the mirror of the HP-50g benchmark, but edited for accuracy. The main loop only represents a tiny snippet, the rest of the code is there for increasing accuracy / not being bothered by the Break upon ON keypress / etc.
Those benchmarks would take #4 and #6 spots.
Lionel Debroux wrote:

For TI-68k/AMS/BASIC, it could be interesting to evaluate the speed with local variables ?


Of course! (almost) all implementations are interesting!

Quote:

I have posted a pair of C benchmarks on TI-Planet, one being the mirror of the HP-50g benchmark, but edited for accuracy. The main loop only represents a tiny snippet, the rest of the code is there for increasing accuracy / not being bothered by the Break upon ON keypress / etc.
Those benchmarks would take #4 and #6 spots.


Actually the #2 and the #4 thanks to your observations Smile, and thanks a lot!

PS: someone with a nspire?
However, the 50g is emulating the Saturn processor, which would really hurt performance. (But I think there's some tighter code loops that are thunking down to native ARM code?)
When using Saturn ASM, the 50g is indeed slower than the TI-68k is; when using native ARM code, the 50g is between 6x and 7x faster.
Right, but UserRPL would be primarily Saturn code.
Another thing is that stack manipulations are very fast on the HP calculators. I did some tests on the HP 50g (I'll post those and the rest of my results once I get a chance) with local and global variables, too. In the latter cases, UserRPL code actually seemed to give results more comparable to the TI-89. But using just the stack and/or SysRPL, and it blows the 89's global variable benchmarks away.

Incidentally, another interesting thing I've noticed is that for simple integer arithmetic, ints ("exact" mode) are usually much faster than reals ("approx" mode) on the TI-89. On the 50g, it's just the opposite: reals are much faster for integer math than the CAS integer data type.
That would likely be because (IIRC, someone correct me if I'm wrong) ints are part of the stuff added on in the 49G, whereas reals are part of the native underlying OS, and what everything was designed around.
Probably so. The zint code in the 50g seems to be implemented primarily in Saturn ASM. The real/FP code is probably much more optimized and/or a built-in feature of the Saturn and/or ARM processors, since it's used virtually everywhere.

On the other hand, I don't even think the 68000 has native FP. It all has to be done in software, doesn't it?
As far as I know, the real code is Saturn assembly as well, and is the same as the code used in every other Saturn-based calculator for BCD arithmetic. Don't think there's even any thunking to ARM on the 50g.

It's my understanding that HP actually reimplemented the Saturn math libraries in C, for the 20b/30b, 10bII+, 39gII, and Prime, so that those machines would be mathematically consistent with the Saturn-based (and emulating) machines.
Neither the ARM7 used in the 49G+ and its offspring, nor the ARM9 used in the Nspire (and Prime), nor the 68000 used in the TI-68k series, have native support for floating-point.
Lionel Debroux wrote:
Neither the ARM7 used in the 49G+ and its offspring, nor the ARM9 used in the Nspire (and Prime), nor the 68000 used in the TI-68k series, have native support for floating-point.


It seems so, Tim Wessman (one of the HP calculator division), confirmed it ( http://www.hpmuseum.org/ search for: Message #19 Posted by Tim Wessman on 13 Sept 2013, 12:07 p.m. , i can't link it, the thread is not archived). So is not easy to do a lot of mathematical tasks. Great engineers/programmers!
Naive primes results:

(Note: results accurate to around +/- 1 second, the resolution of the built-in timer)

TI-89 Titanium, AMS 3.10, HW4, amspatch, TI-BASIC, n=100:
AUTO: 14s
EXACT: 14-15s
APPROX: 28s

TI-89 Titanium, AMS 3.10, HW4, amspatch, TI-BASIC, n=1000:
AUTO: 976-977s
EXACT: 975-976s
APPROX: 1894-1895s

TI-89, AMS 2.08, HW2, amspatch, TI-BASIC, n=100:
AUTO: 17-18s
EXACT: 18s
APPROX: 30s

TI-89, AMS 2.08, HW2, amspatch, TI-BASIC, n=1000:
AUTO: 1063-1064s
EXACT: 1062-1063s
APPROX: 1814-1815s

Code for all tests:

Code:
prime(n)
Prgm
Local k,j
For k,3,n
 For j,2,k-1
  If mod(k,j)=0:Exit
 EndFor
EndFor
EndPrgm


I noticed you posted this topic on comp.sys.hp48; I'll post my HP 50g results there.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement