Re: Functions using locks are slowed even when locks are never taken

2013-11-02 Thread Trenton Strong
Verified that I receive the same result patterns as you on my machine. One other possibility outside of what you have already mentioned would be something JIT-related. Perhaps there is an optimization that can be performed if the locking sections of the code are in another function but otherwi

Re: Question regarding structural sharing, records, and maps

2011-07-29 Thread Trenton Strong
On Jul 29, 4:38 am, Ken Wesson wrote: > Yes. In fact this should work with records, too -- all the "native" > fields of the record need to be copied for each version, but most will > typically be pointers and most of those will typically be to existing > objects. Only the ones that were changed wi

Re: Question regarding structural sharing, records, and maps

2011-07-29 Thread Trenton Strong
On Jul 29, 8:58 am, Michael Gardner wrote: > > An atom would be more appropriate, unless you're coordinating updates to the > tree with updates to some other ref. Ah, for some reason that didn't occur to me, thanks. Since the tree in this case acts as a supporting index on spatial data, it pret

Question regarding structural sharing, records, and maps

2011-07-29 Thread Trenton Strong
Hi all, this is my first post. I'm currently building a tree data structure (quadtree to be exact) while doing some exploratory game server programming using Clojure. This tree will end up with a lot of "entities" stored in the nodes, whose positions determine which node they end up in. As game s