Skip to content

Conversation

@carterkozak
Copy link
Contributor

We expect unlimited keyspace due to maps keyed by random IDs which are usually UUID-based. This interacts poorly with string canonicalization components in Jackson in ways that cause heavy heap churn. See the discussion here for the details:
FasterXML/jackson-benchmarks#6

==COMMIT_MSG==
Opt out of canonicalization in Conjure JsonFactories
==COMMIT_MSG==

Possible downsides?

The primary risk is that without canonicalization, we allocate reused strings much more heavily. Strings used to match setter methods should be very short lived and should not escape the parsing thread, so the JIT may be able to do terribly clever things to help us out.

Note: it may be possible to canonicalize contextually in jackson 3, which would give us the best of both worlds!

We expect unlimited keyspace due to maps keyed by random IDs which
are usually UUID-based. This interacts poorly with string
canonicalization components in Jackson in ways that cause heavy heap
churn. See the discussion here for the details:
FasterXML/jackson-benchmarks#6

The primary risk is that without canonicalization, we allocate
reused strings much more heavily. Strings used to match setter
methods should be very short lived and should not escape the
parsing thread, so the JIT may be able to do terribly clever
things to help us out.

Note: it may be possible to canonicalize contextually in jackson
3, which would give us the best of both worlds!
@changelog-app
Copy link

changelog-app bot commented Apr 20, 2023

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Opt out of canonicalization in Conjure JsonFactories

Check the box to generate changelog(s)

  • Generate changelog entry

@bulldozer-bot bulldozer-bot bot merged commit b3686ca into develop Apr 20, 2023
@bulldozer-bot bulldozer-bot bot deleted the ckozak/no_canonicalization branch April 20, 2023 21:02
@schlosna
Copy link
Contributor

Example snapshot from com.fasterxml.jackson.perf.json.JsonArbitraryFieldNameBenchmark.parse-AverageTime-mode-NO_INTERN-shape-RANDOM_KEY_MAP-type-INPUT_STREAM/profile.jfr shows significant Arrays.copyOf via void com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer._verifySharing():1005 which we have seen in Conure based services.

image

@svc-autorelease
Copy link
Collaborator

Released 7.53.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants