Re: Linked Hash Map/Set

2014-04-16 Thread Frankie Sardo
For anybody interested, I manage to improve performance up to ~2x slower than standard hash-map and pushed it to clojars. https://github.com/frankiesardo/linked linked-set is still a bit slow so I'll keep investigating on it. On Tuesday, April 15, 2014 2:31:14 PM UTC+2, Frankie Sardo wrote: > >

Re: Linked Hash Map/Set

2014-04-15 Thread Frankie Sardo
Thanks for the pointers Andy. I had a look at the ordered-map and indeed is a smart and fast implementation. However it relies on continuously growing a backing array, filling dissoc-iated values with nil and hoping that at one point the user will call (compact map) to free all the unused positi

Re: Linked Hash Map/Set

2014-04-14 Thread Andy Fingerhut
You may also want to take a look at the 'ordered' library, intended to achieve a similar affect as you describe of remembering elements in the order they were inserted. I don't know which of the two Github repos below is the current latest one, but it should be one of them: https://github.com

Re: Linked Hash Map/Set

2014-04-14 Thread Andy Fingerhut
I don't have time right now to look at the details of your implementation, but can answer at least one of your questions. Clojure's normal PersistentHashMap data structure does create a new object for every key you remove (with dissoc), add, or modify the value for (with assoc). So if a single as

Linked Hash Map/Set

2014-04-14 Thread Frankie Sardo
I'm on a mission to implement an ordered map and set structure for Clojure. Much like LinkedHashMap for Java but as a persistent data structure. The idea is that instead of saving a simple [k v] MapEntry we can save [k v left-node-key right-node-key] plus a global head-node-key to walk through t