Post Reply 
[SOLVED] DSRN (dog slow roman numerals)
06-15-2014, 01:22 AM
Post: #28
RE: DSRN (dog slow roman numerals)
(06-13-2014 05:15 PM)DavidM Wrote:  I was curious as to how these various algorithms performed, so I did some testing and came up with the following for cycle timings:

HP1 (HP67's original): 0.11592 sec
DB1: 0.07968 sec
TK1: 0.13363 sec
TK2: 5.02521 sec
DM1: 0.91066 sec
TK3: 0.89567 sec

Very interesting thread.
I did a series of runs of the same code on newRPL (running on a PC, not on real hardware). I ran 100 times your loop from 1000 to 1499 to get more accurate time measurements. They are not comparable with your results but comparing between algorithms shows how a different implementation of RPL can affect the times:

HP1: 0.789 seconds
DB1: 0.516 seconds
TK1: 0.793 seconds
TK2: 1.173 seconds

Scaling everything to the original HP1 algorithm I get:

userRPL / newRPL
HP1 (by definition) = 1.0 / 1.0
DB1 = 0.687 / 0.653
TK1 = 1.153 / 1.005
TK2 = 43.351 / 1.487

So it seems in terms of loops, newRPL and userRPL show about the same ratios. Actually, TK1, which is more dependent on local variable evaluation shows newRPL doing a little better. List processing (STREAM used in TK2), however, shows only a slight slowdown in newRPL (expected due to the overhead of manipulating lists), versus a huge slowdown in userRPL. This might be due to list processing being implemented in sysRPL in the ROM.
I couldn't run TK2 and DM since they use a couple of words that aren't implemented yet.

(06-13-2014 05:15 PM)DavidM Wrote:  While doing the timings, I also found a bug in my app. If the resulting string only has one character (as in "M" for 1000), \GSLIST will error out proclaiming an invalid dimension. So I had to insert an empty string into the list ("" +) just before \GSLIST was called to make sure it always had something to add.

I found that behavior when implementing \GSLIST and it didn't make any sense. The sum of an empty list should give an error, but a list with one element has a clear result. So in newRPL that command is implemented as it should be.
I couldn't run your version, but your code would've executed correctly under newRPL.

Claudio
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: DSRN (dog slow roman numerals) - HP67 - 06-11-2014, 07:06 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 11:44 AM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 04:49 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-15-2014, 12:02 PM
RE: DSRN (dog slow roman numerals) - HP67 - 06-16-2014, 06:09 AM
RE: DSRN (dog slow roman numerals) - HP67 - 06-12-2014, 05:46 PM
RE: DSRN (dog slow roman numerals) - Claudio L. - 06-15-2014 01:22 AM



User(s) browsing this thread: