liangyepianzhou commented on PR #25367:
URL: https://github.com/apache/pulsar/pull/25367#issuecomment-4286350318

   > I think we should not depend much from the cache itself. The `TopicName` 
construction is low-efficient and used nearly everywhere. Could you try my 
previous patch here (#24463) to see if there is any improvement? If so, I can 
resolve the conflicts again
   
    After applying your optimization, the benchmark results are as follows: 
jmh2 uses `computeIfAbsent`, jmh1 uses `put`.
   
   Benchmark                           Mode  Cnt  Score   Error  Units
   TopicNameGetBenchmark.coldStartGet    ss   50  5.600 ± 1.722  us/op
   [1]+  Done                    java -jar ./microbench-*-benchmarks.jar 
TopicNameGetBenchmark 2>&1 > jmh1.log
   
   Benchmark                           Mode  Cnt  Score   Error  Units
   TopicNameGetBenchmark.coldStartGet    ss   50  6.446 ± 2.168  us/op
   [1]+  Done                    java -jar ./microbench-*-benchmarks.jar 
TopicNameGetBenchmark 2>&1 > jmh2.log


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to