On Sat, Feb 19, 2011 at 2:05 AM, John Lato <[email protected]> wrote: > On Fri, Feb 18, 2011 at 1:14 AM, Sebastian Fischer <[email protected]>wrote: > >> Maybe one of the simpler structures presented there (like random access >> lists) provides faster indexing. >> > > I believe the difficulty with random access lists is in dropping references > to old data. I don't see how to do so efficiently. >
Instead of shifting all elements through the buffer you could store an index to the oldest element and increase it (modulo size) when overwriting. Then the only operations you need internally are reading and writing at arbitrary positions, for which IntMap also seems like a good candidate. You could also try the new hash maps: http://blog.johantibell.com/2011/02/new-faster-containers-library.htmlalthough I don't see a reason why they should be faster than IntMaps. Sebastian
_______________________________________________ haskell-art mailing list [email protected] http://lists.lurk.org/mailman/listinfo/haskell-art
