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

Avoid using thread-local WriteSet when possible #3829

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

merlimat
Copy link
Contributor

@merlimat merlimat commented Mar 1, 2023

Motivation

For computing WriteSet we use a Recycler to avoid instantiating a new object each time. While that avoid allocations, it's based on thread-locals and has non-zero cost.

In most cases the usage of WriteSet that we are doing is very basic:

  • Get a WriteSet from the recycler
  • check the bookie indices
  • recycle the write-set

Instead, we can just expose a method in the DistributionSchedule interface and avoid any recycler or object allocations.

@merlimat merlimat added this to the 4.16.0 milestone Mar 1, 2023
@merlimat merlimat self-assigned this Mar 1, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2023

Codecov Report

Merging #3829 (dde5a59) into master (a96317e) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #3829      +/-   ##
============================================
- Coverage     68.35%   68.34%   -0.02%     
- Complexity     6757     6768      +11     
============================================
  Files           473      473              
  Lines         40963    40950      -13     
  Branches       5241     5240       -1     
============================================
- Hits          28002    27987      -15     
- Misses        10706    10712       +6     
+ Partials       2255     2251       -4     
Flag Coverage Δ
bookie 39.87% <47.36%> (-0.07%) ⬇️
client 44.18% <100.00%> (-0.03%) ⬇️
remaining 29.52% <57.89%> (-0.11%) ⬇️
replication 41.42% <84.21%> (-0.01%) ⬇️
tls 21.01% <42.10%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...apache/bookkeeper/client/DistributionSchedule.java 9.09% <ø> (ø)
...rg/apache/bookkeeper/conf/ServerConfiguration.java 77.49% <ø> (-0.17%) ⬇️
...ain/java/org/apache/bookkeeper/bookie/Journal.java 81.43% <100.00%> (-1.10%) ⬇️
...va/org/apache/bookkeeper/client/LedgerChecker.java 81.55% <100.00%> (-0.09%) ⬇️
...ava/org/apache/bookkeeper/client/PendingAddOp.java 87.62% <100.00%> (-1.22%) ⬇️
...rg/apache/bookkeeper/client/PendingWriteLacOp.java 73.17% <100.00%> (-1.25%) ⬇️
...kkeeper/client/RoundRobinDistributionSchedule.java 84.73% <100.00%> (-1.36%) ⬇️
...keeper/meta/AbstractHierarchicalLedgerManager.java 72.97% <0.00%> (-4.06%) ⬇️
...apache/bookkeeper/bookie/LedgerDescriptorImpl.java 68.42% <0.00%> (-3.51%) ⬇️
...er/util/collections/ConcurrentLongLongHashMap.java 78.71% <0.00%> (-1.99%) ⬇️
... and 26 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@merlimat merlimat merged commit 20aad80 into apache:master Mar 2, 2023
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants