On Thursday 23 August 2007 14:16:58 Ian Rogers wrote: > Hi, > > here is a revision of Daniel's patch, from Daniel, that revises a bug > with InheritableThreadLocals not calling childValue. This bug was found > through the JSR 166 TCK, which now passes its thread local tests. > > Thanks, > Ian > > Daniel Frampton wrote: > > In order to tease out where the performance differences were coming > > from, I implemented a map specialized for thread locals > > (ThreadLocalMap.java) and found that the performance is essentially the > > same as the version Ian posted earlier that stores ThreadLocal data in a > > per-thread direct indexed array. > > > > Steve ran the numbers for first and third iteration performance (-1 and > > -3). > > > > http://cs.anu.edu.au/people/Steve.Blackburn/jikesrvm/vole-2007-08-22-Wed > > -213259-1.txt > > http://cs.anu.edu.au/people/Steve.Blackburn/jikesrvm/vole-2007-08-22-Wed > > -213259-3.txt > > > > All numbers are from JikesRVM and listed from left to right are the > > original (WeakIdentityHashMap) the array version suggested by Ian, and > > the ThreadLocalMap version. > > > > The implementation is essentially a map of weak references to values > > that are lazily cleaned up as the map is manipulated. I think this is a > > good balance of performance and design, but I am open to suggestions. To > > allow other VMs to benefit from this I have made all these changes > > within classpath (patch attached). > > > > The job still remains to improve the WeakIdentityHashMap so it does not > > perform allocation as it searches the buckets in the fast case for a > > simple get(), but I believe that optimizing the ThreadLocal case is > > worthwhile regardless as in some benchmarks they are performance > > critical. > > > > Thanks & Regards, > > Daniel Frampton.
This patch is being used by JikesRVM. Does anyone have any thoughts on committing it to Classpath? See: http://jira.codehaus.org/browse/RVM-185 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33690 -- Andrew :)
