yunmaoQu opened a new pull request, #23808:
URL: https://github.com/apache/pulsar/pull/23808
### Motivation
Schema creation (e.g., `Schema.AVRO(SomeClass.class)`) is fairly CPU
intensive. It would be useful it there would be a weak reference cache for
caching the schema instance.
### Modifications
- Add SchemaCache implementation using WeakHashMap for schema instance
caching
- Add cache configuration and metrics for monitoring
- Add cleanup strategy for expired cache entries
- Modify Schema creation methods (AVRO/JSON/PROTOBUF) to use cache
- Add cloning mechanism to maintain schema immutability
### Documentation
- [x] doc-not-needed
No documentation changes required as this is an internal performance
optimization
### Matching PR in forked repository
N/A
--
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]