Optimize PrefRecorder slightly

This commit is contained in:
James Seibel
2025-11-07 07:41:59 -06:00
parent 67637dbf10
commit 7e04b12e37
@@ -175,7 +175,14 @@ public class PerfRecorder
long endTime = System.nanoTime();
long totalNano = endTime - this.startTime;
LongAdder nsAdder = PerfRecorder.this.nanoPerId.computeIfAbsent(this.id, (String id) -> new LongAdder());
LongAdder nsAdder = PerfRecorder.this.nanoPerId.get(this.id);
if (nsAdder != null)
{
nsAdder.add(totalNano);
return;
}
nsAdder = PerfRecorder.this.nanoPerId.computeIfAbsent(this.id, (String id) -> new LongAdder());
nsAdder.add(totalNano);
}
}