Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor StoreTailer.readingDocument #1414

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

tgd
Copy link
Contributor

@tgd tgd commented Aug 10, 2023

Refactoring made during benchmarking session focusing on tailer throughput. The following differences were observed between this branch and develop during benchmarking:

Case L1 loads L1 load misses Total branch misses
develop 141000 17000 25.7%
feature branch 141000 15000 22.64%

This feature branch does the following:

  • Adds some javadoc
  • Cleans up some methods and encapsulates some logic
  • Moves some code off the hot path

#1415

@tgd tgd requested a review from rogersimmons August 10, 2023 22:01
@tgd tgd changed the title Refactor StoreTailer.readDocument Refactor StoreTailer.readingDocument Aug 10, 2023
@sonarcloud
Copy link

sonarcloud bot commented Aug 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

76.9% 76.9% Coverage
0.0% 0.0% Duplication

@tgd tgd requested a review from nicktindall March 5, 2024 08:59
@tgd tgd force-pushed the feature/refactor_StoreTailer_readDocument branch from 149451e to d44dd6e Compare March 5, 2024 10:10
Copy link

sonarcloud bot commented Mar 5, 2024

this.lastReadIndex = this.index();
return context;
// An entry has been found, prepare the context and return it.
if (next && (context.wire() != null)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice we went from if (wire != null && context.present(next)) to if (next && context.wire() != null) I can see that context.present(...) just returns the value passed in but it also has the side-effect 🤮 of setting the present field in the context.

Is that change significant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see it happens in init now. Much nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants