bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

LedgerHandle: eliminate unnecessasary synchronization on LedgerHandle.getLength()

Open eolivelli opened this issue 1 year ago • 0 comments

Motivation

I have seen that calling getLength() creates unnecessary contention with threads that are appending entries. This can be easily eliminate by using AtomicLong.

I cannot share flame graphs as I have found this on some propriatery application using BookKeeper.

Changes

  • move LedgerHandle length to AtomicLong
  • remove synchronized in LedgerHandle.getLength()

eolivelli avatar Oct 19 '24 08:10 eolivelli