[
https://issues.apache.org/jira/browse/IGNITE-2333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15082693#comment-15082693
]
Vladimir Ozerov commented on IGNITE-2333:
-----------------------------------------
Quick and dirty prototype. Shown ~10-15% increase in throughput for single-node
PUT benchmark.
{code}
public class StripedRWL implements ReadWriteLock {
private final PaddedRWL[] locks;
public StripedRWL() {
locks = new PaddedRWL[16];
for (int i = 0; i < locks.length; i++)
locks[i] = new PaddedRWL();
}
private static final ThreadLocal<Integer> IDX = new ThreadLocal<Integer>() {
@Override protected Integer initialValue() {
return ThreadLocalRandom.current().nextInt(100000) % 16;
}
};
@NotNull @Override public Lock readLock() {
return locks[IDX.get()].readLock();
}
@NotNull @Override public Lock writeLock() {
return locks[IDX.get()].writeLock();
}
private static class PaddedRWL extends ReentrantReadWriteLock {
long p0, p1, p2, p3, p4, p5, p6, p7;
}
}
{code}
> Hotspot in GridDhtPartitionTopologyImpl readLock() and readUnlock() methods
> ---------------------------------------------------------------------------
>
> Key: IGNITE-2333
> URL: https://issues.apache.org/jira/browse/IGNITE-2333
> Project: Ignite
> Issue Type: Sub-task
> Components: cache, general
> Affects Versions: ignite-1.4
> Reporter: Vladimir Ozerov
> Fix For: 1.6
>
>
> When running simple PUT benchmark in ATOMIC cache, read lock-unlock consumes
> up to 10% of time.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)