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 2026/09/10 12:56:12 UTC

[PR] [improve][ml] Avoid capturing cache insertion arguments [pulsar]

lhotari opened a new pull request, #26524:
URL: https://github.com/apache/pulsar/pull/26524

   ### Motivation
   
   RangeCache.put creates a callback capturing the cache, key and entry size on every insertion, although those values are already initialized on the wrapper.
   
   ### Modifications
   
   Replace the capturing callback with a static method reference that reads initialized wrapper fields under the existing wrapper write lock. Preserve map/queue insertion, size accounting, failed-insertion recycling and value release order. Include an insertion/eviction benchmark and a Netty-thread JMH executor.
   
   ### Verifying this change
   
   Historical JMH with active Netty recycling saved approximately 32 B per insertion (about 23% allocation in the measured cycles); times improved only 0.9–2.8%. The target allocation disappeared in profiling, but total broker allocation rose 1.4% amid unrelated allocation changes. No aggregate performance gain is claimed. Use -Djmh.executor=CUSTOM -Djmh.executor.class=org.apache.pulsar.client.impl.FastThreadLocalBenchmarkExecutor in benchmark fork JVMs for representative recycling.
   
   Local extraction validation passed: `spotlessCheck checkstyleMain checkstyleTest`, benchmark compilation, and 34 scoped tests with no failures or skips: org.apache.bookkeeper.mledger.impl.cache.RangeCacheRemovalQueueTest (7), org.apache.bookkeeper.mledger.impl.cache.RangeCacheTest (12), org.apache.bookkeeper.mledger.impl.cache.RangeEntryCacheImplTest (15). Retries were disabled; Gradle ran with `--max-workers=2 --no-parallel`.
   
   - [ ] Make sure that the change passes the CI checks.
   
   ### Does this pull request potentially affect one of the following parts:
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   


-- 
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] Avoid capturing cache insertion arguments [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #26524:
URL: https://github.com/apache/pulsar/pull/26524


-- 
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