Post Reply 
Speed: Free42 vs Hp prime application on android (and if possible, other emulators)
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
Post Reply 


Messages In This Thread



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