Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make an optimization to store lower/upper case letters of target keys #24

Closed
wants to merge 1 commit into from

Conversation

gavlyukovskiy
Copy link
Collaborator

This PR introduces an optimization to move toLowerCase conversion to the initialization time, so that we don't ever have to convert characters from original keys anymore.

Before:

Benchmark                               (jsonSize)  (maskedKeyProbability)  (obfuscationLength)   Mode  Cnt      Score   Error  Units
JsonMaskerBenchmark.baselineCountBytes       128kb                    0.01                 none  thrpt       23437,517          ops/s
JsonMaskerBenchmark.jacksonString            128kb                    0.01                 none  thrpt         499,279          ops/s
JsonMaskerBenchmark.jsonMaskerBytes          128kb                    0.01                 none  thrpt        3912,536          ops/s
JsonMaskerBenchmark.jsonMaskerString         128kb                    0.01                 none  thrpt        3673,244          ops/s

After:

Benchmark                               (jsonSize)  (maskedKeyProbability)  (obfuscationLength)   Mode  Cnt      Score   Error  Units
JsonMaskerBenchmark.baselineCountBytes       128kb                    0.01                 none  thrpt       23478,395          ops/s
JsonMaskerBenchmark.jacksonString            128kb                    0.01                 none  thrpt         487,419          ops/s
JsonMaskerBenchmark.jsonMaskerBytes          128kb                    0.01                 none  thrpt        5676,287          ops/s
JsonMaskerBenchmark.jsonMaskerString         128kb                    0.01                 none  thrpt        5332,056          ops/s

Copy link

sonarcloud bot commented Dec 20, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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

Successfully merging this pull request may close these issues.

1 participant