Post Reply 
Speed: Free42 vs Hp prime application on android (and if possible, other emulators)
08-14-2017, 04:00 PM (This post was last modified: 08-14-2017 04:01 PM by pier4r.)
Post: #1
Speed: Free42 vs Hp prime application on android (and if possible, other emulators)
I was wondering, did someone compare the free42 app vs the HP prime app in some common application (for both apps) on the same android device. Like a savage benchmark? (that uses many common math functions)

If yes, how is the speed comparison? It would surprise me greatly to see the Free42 being able to keep up with the official HP android app.

Did someone test also other emulator/simulators of HP calcs? I would expect that the majority of emulators would be way slower than simulators, but one never knows until one tests them.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
08-14-2017, 07:08 PM (This post was last modified: 08-14-2017 07:11 PM by rprosperi.)
Post: #2
RE: Speed: Free42 vs Hp prime application on android (and if possible, other emulators)
(08-14-2017 04:00 PM)pier4r Wrote:  It would surprise me greatly to see the Free42 being able to keep up with the official HP android app.

Why would you expect Free42 to be slower? Free42 is a simulator of the 42S written 'from-scratch' in C (possibly C++, but it's so portable, I'm guessing C), and is not an emulator at all. That said, 42 programs are running a semi-interpreted language, not compiled machine code, so it may actually be comparable with a program written in the HPPL language used on the Prime (which I believe to be similar to p-code, but could be wrong).

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
08-14-2017, 09:03 PM
Post: #3
RE: Speed: Free42 vs Hp prime application on android (and if possible, other emulators)
(08-14-2017 07:08 PM)rprosperi Wrote:  Why would you expect Free42 to be slower? Free42 is a simulator of the 42S written 'from-scratch' in C (possibly C++, but it's so portable, I'm guessing C), and is not an emulator at all.

I know this (and it is a great work!). But I would expect the dev from HP to employ more polished code. It is a matter of manhours. Thomas is alone vs a dev team that is made by multiple people.

Maybe for some procedures the available libraries in C are already well beyond being polished, bur for others I would expect the HP team to have an advantage.

Of course, I could be wrong, indeed I am asking.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
08-15-2017, 03:51 AM (This post was last modified: 08-15-2017 10:54 AM by Thomas Okken.)
Post: #4
RE: Speed: Free42 vs Hp prime application on android (and if possible, other emulator
(08-14-2017 10:28 PM)Mike (Stgt) Wrote:  
(08-14-2017 09:03 PM)pier4r Wrote:  [...] Thomas is alone [...]

He uses the Intel Decimal Floating-Point Math Library -- so he is not alone.

Ciao.....Mike

Indeed. Most of the work that happens when Free42 runs a floating-point-intensive program happens in the math library.
The part of Free42 that actually runs HP-42S programs is pretty efficient; you can see the whole thing by just looking at these functions:

continue_running() in core_main.cc
get_next_command() in core_globals.cc
find_local_label() in core_globals.cc
handle_error() in core_main.cc

That's about 240 lines of code, of which only a small part is executed for every program line.
Most of the work happens in the instruction handlers, i.e. the
Code:
error = cmdlist(cmd)->handler(&arg);
line in continue_running(), and most of the overhead in those handlers is stack manipulation, which, in turn, is mostly memory management, in which most of the malloc/free overhead is eliminated by using object pools... I could go on, but suffice it to say, it's code that is fairly simple and pretty efficient.

I've never tried comparing Free42's performance on the Savage any benchmark to pure native code, but I would expect it to be pretty close... And even if it isn't, my main objective in this design was to be in the ballpark of the real HP-42S while running on the Palm m100. Having achieved that, all the speed gains caused by how much faster hand-held hardware has become in the nearly 13 years since then are just gravy. If Free42 can come even close to keeping up with native code, that's neat, but that wasn't what I was going for, when I started coding an HP-42S replacement. :-)
Visit this user's website Find all posts by this user
Quote this message in a reply
08-15-2017, 06:21 AM
Post: #5
RE: Speed: Free42 vs Hp prime application on android (and if possible, other emulators)
Good to know! For me the design should be always pointing to effectiveness first (in this case: working functions and correct results) so I wouldn't mind speed, I was just curios.

If you use a library from Intel, then it is even more interesting. I guess I'll have to run some tests on my own since likely no one did them.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)