You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Ozerov (JIRA)" <ji...@apache.org> on 2016/02/08 10:28:39 UTC
[jira] [Created] (IGNITE-2582) j.u.Collections.singletonIterator()
allocations during TX cache puts.
Vladimir Ozerov created IGNITE-2582:
---------------------------------------
Summary: j.u.Collections.singletonIterator() allocations during TX cache puts.
Key: IGNITE-2582
URL: https://issues.apache.org/jira/browse/IGNITE-2582
Project: Ignite
Issue Type: Sub-task
Components: cache
Affects Versions: 1.5.0.final
Reporter: Vladimir Ozerov
Fix For: 1.6
*Problem*
Allocations came from several sources:
1) IgniteTxManager.lockMultiple
2) IgniteTxManager.notifyEvictions
3) IgniteTxManager.removeObsolete
4) IgniteTxManager.unlockMultiple
5) GridDhtTxLocalAdapter.mapExplicitLocks
In all these code pieces we have the same pattern:
{code}
for (T t : collection) {
logic(t)
}
{code}
*Solution*
Perform simple refactoring:
{code}
if (collection isntanceof List) {
for (int i = 0; i < ((List)colllection).size()) {
logic(collection.get(i));
}
}
else {
for (T t : collection) {
logic(t)
}
}
{code}
Though, we should be careful with LinkedList here - such refactoring will slowdown processing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)