You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2025/09/04 07:36:59 UTC
[PR] [improve][ml] Improve cache insert performance by removing exists check since it's already covered by putIfAbsent [pulsar]
lhotari opened a new pull request, #24699:
URL: https://github.com/apache/pulsar/pull/24699
### Motivation
While profiling Pulsar with PulsarProfilingTest, I noticed that a significant part of CPU of an insert to the cache is spent in the existence check. The case where the entry might already be in the cache is already covered by putIfAbsent and it is very rare after the PendingReadsManager solution was introduced to de-duplicate reads.
### Modifications
- remove the exists check before inserting to cache
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][ml] Improve cache insert performance by removing exists check since it's already covered by putIfAbsent [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24699:
URL: https://github.com/apache/pulsar/pull/24699#issuecomment-3252590872
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/24699?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 74.20%. Comparing base ([`2e6a8eb`](https://app.codecov.io/gh/apache/pulsar/commit/2e6a8eb1f200ca687064058a101963713b896fe2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a1fefd6`](https://app.codecov.io/gh/apache/pulsar/commit/a1fefd62c538cb89a09ee10dcddf46e4c7230f9b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/24699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #24699 +/- ##
============================================
- Coverage 74.33% 74.20% -0.13%
+ Complexity 33534 33479 -55
============================================
Files 1895 1895
Lines 147954 147952 -2
Branches 17130 17129 -1
============================================
- Hits 109978 109795 -183
- Misses 29256 29420 +164
- Partials 8720 8737 +17
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/24699/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [inttests](https://app.codecov.io/gh/apache/pulsar/pull/24699/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.27% <100.00%> (-0.39%)` | :arrow_down: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/24699/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `22.68% <100.00%> (-0.07%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/24699/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.72% <100.00%> (-0.12%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/24699?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...keeper/mledger/impl/cache/RangeEntryCacheImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/24699?src=pr&el=tree&filepath=managed-ledger%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fbookkeeper%2Fmledger%2Fimpl%2Fcache%2FRangeEntryCacheImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWFuYWdlZC1sZWRnZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9pbXBsL2NhY2hlL1JhbmdlRW50cnlDYWNoZUltcGwuamF2YQ==) | `70.84% <100.00%> (+0.88%)` | :arrow_up: |
... and [99 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/24699/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][ml] Improve cache insert performance by removing exists check since it's already covered by putIfAbsent [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #24699:
URL: https://github.com/apache/pulsar/pull/24699
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org