-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Description
Version 4.8.3
Hi, while profiling my application I saw that 50% of the time spent in JacksonCodec.decode() is actually spent constructing an instance of BsonDocumentCodec.
It is constructed here:
| protected final BsonJavaScriptWithScopeCodec withScopeCodec = new BsonJavaScriptWithScopeCodec(new BsonDocumentCodec(MongoClientSettings.getDefaultCodecRegistry())); |
Having one JsonParserAdapter instance per decode() call makes sense, because it holds parsing state. But I think the
withScopeCodec property and its parameters have no state and just static arguments, so withScopeCodec could also be a static variable.
It would be cool to significantly speed up decoding by reusing this instance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
