BewareMyPower commented on code in PR #24465:
URL: https://github.com/apache/pulsar/pull/24465#discussion_r2168017302
##########
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/LookupProxyHandler.java:
##########
@@ -85,6 +87,9 @@ public class LookupProxyHandler {
.create().register();
private final Semaphore lookupRequestSemaphore;
+ // Maps the topic name from the request to the full topic name
+ private final Map<String, String> topicNameCache = new HashMap<>();
Review Comment:
<img width="1277" alt="image"
src="https://github.com/user-attachments/assets/79c1fe1e-c78a-460a-b15f-4aab1572c102"
/>
Well, if there are 50k keys, `TopicName#get` is slower.
```
TopicNameBenchmark.testConvert thrpt 5.857 ops/s
TopicNameBenchmark.testReadFromCache thrpt 5.326 ops/s
```
--
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]