You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reuse heavy-weight objects: ObjectMapper (data-binding) and JsonFactory (streaming API)
To a lesser degree, you may also want to reuse ObjectReader and ObjectWriter instances -- this is just some icing on the cake, but they are fully thread-safe and reusable
Short version:
PayloadS3Pointer instantiates a new JsonDataConverter for every toJson() invocation.
JsonDataConverter instantiates a new ObjectMapper for every invocation.
Then you could see some performance benefit by having one ObjectMapper per-PayloadStore. But, making a static, hidden, shared ObjectMapper throughout the entire library would see the biggest benefits. Again, probably contained in a Singleton wrapper class that is used and/or injected everywhere.
The text was updated successfully, but these errors were encountered:
Ref:
Short version:
toJson()
invocation.When used via a S3BackedPayloadStore in the SQS Extended Client and sending a ton of SQS messages, this can add up to quite the performance hit.
If you flipped this on its head and
toJson()
methodThen you could see some performance benefit by having one ObjectMapper per-PayloadStore. But, making a static, hidden, shared ObjectMapper throughout the entire library would see the biggest benefits. Again, probably contained in a Singleton wrapper class that is used and/or injected everywhere.
The text was updated successfully, but these errors were encountered: