BewareMyPower commented on PR #24457:
URL: https://github.com/apache/pulsar/pull/24457#issuecomment-3003628757

   You can check 
[benchmark.diff.txt](https://github.com/user-attachments/files/20896048/benchmark.diff.txt)
 for how I set up the tests.
   
   BTW, @codelipenghui  mentioned "over engineering" 
[here](https://github.com/apache/pulsar/pull/24457#discussion_r2165507421). 
However, IMO, the cache itself is "over engineering" to me. I checked many 
places that `TopicName` is used. Mostly it's just used as a temporary variable 
to do some conversion.
   
   Both the existing solution and this solution have issues when a lot of 
different topic names are used. The existing solution relies on manual call of 
`clearIfReachedMaxCapacity`. Introducing a scheduled task also brings 
unnecessary complexity. The solution in this PR relies on GC to clean up 
entries from cache. If any issue happens, it could be harder to diagnose.
   
   Actually, I think we should remove the cache, which brings many issues that 
should never happen. From my perspective, introducing the cache is just to get 
around the poor implementation of `TopicName`'s constructor and it's a "GC 
PTSD" coding style of Pulsar.


-- 
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-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to