infinispan/infinispan — pull request #827 by maniksurtani (2012-01-13 19:50:37+00:00)
Title: Optimize transactions

* Replace lock reordering logic with an array and TimSort rather than costly and frequent construction of a visitor and TreeSet
* Clean up TransactionXaAdapter for readability
* Initialise XID map in XaTransactionTable with proper concurrency level
* Refactor AbstractCacheTransaction to not use a JDK lock, as this is expensive to construct and has significant memory overhead in such a frequently created object. Replacing this logic with tightly encapsulated synchronization on the instance along with object wait/notify works just as well.
* Minimize synchronized access to CacheTransactions