Alexander, Sounds like a useful addition, thanks! Does it make sense to document the usage and specificities you are mentioning on an Ignite wiki page?
— Denis > On Jul 20, 2017, at 9:59 AM, Александр Меньшиков <[email protected]> wrote: > > Hi, guys. I have written benchmarks for comparing IgniteCache.lock() and > Ignite.reentrantLock() and they merged to master branch. > > If someone new wants to make benchmarks look at the implementation. Don't > forget to write both JMH and Yardstick benchmarks. > > In process of writing, I have found out that locks in Ignite have not any > optimization for the situation when locks are unnecessary. So you don't > need adding any operation between lock/unlock operations. Which is not true > for standard Java locks classes because JIT can remove locks with an empty > body. For check such situation you need to make three benchmarks: the first > only with locks but without the body, second with read/write operations but > without locks, and the other with locks and operations. And make sure > result is consistent. It's okay if the third benchmark works faster than > the first and the second in sum. > > Classes: > > 1. JMH: > 1) > org.apache.ignite.internal.benchmarks.jmh.cache.JmhCacheLocksBenchmark > 2. Yardstick: > 1) org.apache.ignite.yardstick.cache.IgniteLockBenchmark > 2) org.apache.ignite.yardstick.cache.IgniteCacheLockBenchmark
