Programming puzzles: processing lists!
|
02-13-2019, 01:30 PM
Post: #269
|
|||
|
|||
RE: Programming puzzles: processing lists!
Nice!
---- Time ago, in this thread or the ListExt thread (or in the little explorations thread) we talked about how slow the expansion of lists is in RPL. Then I asked "ok, what about we go modifying preallocated lists" and DavidM from his huge experience said that there wouldn't be much of a difference, as list have still to be exploded, copied and so on. Today I finally decided to test the question (as with computers we are often fortunate that we can test assertions if we have enough time). This because a recent program on mine based on long lists (1000+ elements) is pretty slow even on the emulator (as the real 50g is already busy). So the question arose again "should I avoid expanding lists?". Here the results saved also in http://www.wiki4hp.com/doku.php?id=rpl:start Code:
I cannot believe the speed on pre allocated arrays (I didn't find a way to expand them without exploding them). I know that they are less flexible than lists, but from 740 seconds to 11 seconds, woah. I contemplated the journey of exploring what I can do using vectors (and matrices?) but I pushed it aside as with lists there are so many commands. Likely now I have to go searching or devising functions that works on vectors especially if I use mostly numerical values. Then I can still employ list of vectors. Wikis are great, Contribute :) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)