Post Reply 
Programming puzzles: processing lists!
02-14-2019, 06:21 PM (This post was last modified: 02-14-2019 08:03 PM by pier4r.)
Post: #275
RE: Programming puzzles: processing lists!
(02-14-2019 05:27 PM)DavidM Wrote:  When you created a type 3 array in your earlier test, you gained an efficiency inherent to that type of object: each element takes up the exact same amount of space, so the offsets to individual elements can be computed in advance and located without having to analyze/traverse all of the preceding elements. That's the main reason that version is faster. It's still making a copy of the original list before making the change, but PUT is far more efficient with a type 3 array object because of how quickly it can locate the target destination within that new copy.

So it is as I guessed. And I normally don't use exact integers, so the type 3 would be the array in my case.

Yes we already discussed "the fastest data structure is the stack" but stackrobatics may be difficult to handle or maintain when there is some operation done in the middle of the procedure. One ideally likes to save the content somewhere, do the operation, then retrieve the content.
Otherwise, at least in theory, everything could be just stack based, but the effort to maintain such programs for me would be too high.
For those that like stackrobatics surely it would be pleasant.

Therefore knowing that other available built in data structures, in this case type 3 array or - I guess - arrays or matrices of elements of a specific maximum memory footprint (reals), are faster to manipulate can be an advantage at times. I say built in as the multistopwatch uses a type of data structure I never saw before that I think it is not user RPL accessible.

For me it was a semi shock as I asked such question in 2013 or the like and the consensus was "between lists and arrays there is not much difference in speed". Having the lists plenty of functions more (thanks to DavidM too), the lists were the way to go until yesterday.

But when A takes ~ 100 time less the speed of B, according to certain programming styles at least, then A becomes attractive to explore. This unless replicating for A the library available for B is too much effort intensive.

heavily edited: why are the first versions of my messages unreadable even by me?

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


Messages In This Thread
RE: Programming puzzles: processing lists! - pier4r - 02-14-2019 06:21 PM



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