Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Performance issue due to redundant serialization/deserialization and recursive iterations #28

Open
cut-to-the-cheese opened this issue May 11, 2021 · 2 comments

Comments

@cut-to-the-cheese
Copy link

Current set of operations:

When a property within the JSON is masked, these operations are performed:

  1. The incoming payload in the json-logger component is deserialized from InputStream into a JSON object.
  2. A deep copy of the JSON object is created.
  3. The masking is applied by recursively iterating over the deep copy.

Issue:

There is an implicit recursive iteration in steps 1 and 2, and an explicit iteration in step 3.

Fix:

Use a custom deserializer for converting the incoming payload of the InputStream type to a JSON object. During the tokenization/detokenization, apply the mask in place and thereby eliminating the need for steps 2 and 3 resulting in a performance gain of up to a factor of 3.

@skuller
Copy link
Contributor

skuller commented May 14, 2021

this is brilliant! Please reach out to @juancavallotti and @DavoCoder to further evaluate the suggested solution!

best,

Andres

@cut-to-the-cheese
Copy link
Author

@skuller thank you for the update. I will check with our team for best path forward.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants