On Fri, Aug 28, 2009 at 4:45 AM, peter veentjer <alarmnum...@gmail.com>wrote:
> > Clojure's STM is part of a holistic language design where > > people will normally be programming with immutable persistent > > composite data structures. Getting a consistent view of such a data > > structure doesn't require a transaction at all, so that is much faster > > than other strategies. When 'changing' a data structure, you read it > > from the ref once and then structural changes do not involve the STM > > or refs. Store it back in the ref when done. Thus the granularity of > > transactions is coarse and the number of ref interactions involved > > small. These are not things you'll see when timing pounding an integer > > in a transactional ref in a tight loop, but matter greatly in > > practice, IMO. > > I partly agree. One of my design guidelines is that one should not > have to pay > for what is not being used. > > One of the things I'm focussing on is making the transaction > as fast as possible for any length. I'm working on a system that > advices the > creation of a transaction with the maximum number of attached objects. > I have > a transaction optimised for a single attachment (5+M transactions/ > second on a single core), > for a small number of attachments (so using an array to store attached > items to reduce object creation) > and one for a large number of attachments (so using an expensive > hashmap). > The later one also is going to get a parallel commit (so obtaining > locks/checking for > isolation problems.. and doing the write) to make effective use of the > cores and speed > up the commit of larger transactions. For a single "attachment" Clojure has atoms and agents instead of an optimized specialization of refs and dosync. :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---