Improve SegmentedJournalReader performance

Description

SegmentedJournalReader has two modes of operation based on JournalReader.Mode, which is an invariant known at instantiation time. We do not amortize this invariant, leaving each invocation of SegmentedJournalReader.hasNext() checking it all over again.

Since Java is an object-oriented language, we can express this invariant in the class hierarchy by having two implementation classes – one for Mode.ALL and one for Mode.COMMITS. This will not only simplify the code, but also allow the JVM to see what is going on.

While we are in this area, also explore other optimization opportunities.

Activity

Show:
Done

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

Created March 12, 2024 at 9:08 PM
Updated March 14, 2024 at 10:13 AM
Resolved March 14, 2024 at 10:13 AM