SwayDB
SwayDB copied to clipboard
Use LongAdder instead of AtomicLong for maintaining read references to a file
Memory-mapped files currently maintain a read reference counter (AtomicLong) so that the memory-cleaner knows to clear mapped bytes only when the file is not being accessed.
Since clear is most likely to never occur or occur very rarely (only 1s) in comparison to reads, LongAdder should yield better performance.