Skip to content

Disable INTERN_FIELD_NAMES to reduce contention during json serde#28461

Merged
wendigo merged 1 commit intomasterfrom
user/serafin/disable-field-interning
Feb 25, 2026
Merged

Disable INTERN_FIELD_NAMES to reduce contention during json serde#28461
wendigo merged 1 commit intomasterfrom
user/serafin/disable-field-interning

Conversation

@wendigo
Copy link
Contributor

@wendigo wendigo commented Feb 25, 2026

Description

airlift/airlift#1793

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Feb 25, 2026
@wendigo wendigo requested review from findepi and martint February 25, 2026 11:44
@wendigo wendigo force-pushed the user/serafin/disable-field-interning branch from d13666b to d895977 Compare February 25, 2026 16:25
@wendigo wendigo requested a review from losipiuk February 25, 2026 18:33
* impact - field name deduplication becomes slightly less memory-efficient, but the
* elimination of lock contention far outweighs this cost in high-concurrency scenarios.
*
* @see <a href="https://github.com/FasterXML/jackson-core/issues/332">Jackson issue on InternCache contention</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something to revisit in the future given this is seen as a bug in Jackson?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we switch to Jackson 3.0 it won't be needed:

And for TL;DNR observers, Jackson 3.0 DOES NOT use String.intern() by default,
and the implementation is such that it typically performs at same level with or without intern()ing, including usage through databinding.

@wendigo wendigo merged commit 90743b4 into master Feb 25, 2026
106 of 108 checks passed
@wendigo wendigo deleted the user/serafin/disable-field-interning branch February 25, 2026 19:24
@github-actions github-actions bot added this to the 480 milestone Feb 25, 2026
@findepi
Copy link
Member

findepi commented Mar 2, 2026

if we change airlift default

why also change in trino?

$ git grep INTERN_FIELD_NAMES
client/trino-client/src/main/java/io/trino/client/TrinoJsonCodec.java:import static com.fasterxml.jackson.core.JsonFactory.Feature.INTERN_FIELD_NAMES;
client/trino-client/src/main/java/io/trino/client/TrinoJsonCodec.java:                 * Disabling INTERN_FIELD_NAMES eliminates this contention with minimal performance
client/trino-client/src/main/java/io/trino/client/TrinoJsonCodec.java:                .disable(INTERN_FIELD_NAMES)
core/trino-main/src/main/java/io/trino/util/JsonUtil.java:import static com.fasterxml.jackson.core.JsonFactory.Feature.INTERN_FIELD_NAMES;
core/trino-main/src/main/java/io/trino/util/JsonUtil.java:                 * Disabling INTERN_FIELD_NAMES eliminates this contention with minimal performance
core/trino-main/src/main/java/io/trino/util/JsonUtil.java:                .disable(INTERN_FIELD_NAMES)
lib/trino-hive-formats/src/main/java/io/trino/hive/formats/esri/EsriReader.java:import static com.fasterxml.jackson.core.JsonFactory.Feature.INTERN_FIELD_NAMES;
lib/trino-hive-formats/src/main/java/io/trino/hive/formats/esri/EsriReader.java:            .disable(INTERN_FIELD_NAMES)
lib/trino-hive-formats/src/main/java/io/trino/hive/formats/line/json/JsonDeserializer.java:import static com.fasterxml.jackson.core.JsonFactory.Feature.INTERN_FIELD_NAMES;
lib/trino-hive-formats/src/main/java/io/trino/hive/formats/line/json/JsonDeserializer.java:            .disable(INTERN_FIELD_NAMES)

* impact - field name deduplication becomes slightly less memory-efficient, but the
* elimination of lock contention far outweighs this cost in high-concurrency scenarios.
*
* @see <a href="https://github.com/FasterXML/jackson-core/issues/332">Jackson issue on InternCache contention</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a javadoc. Why use javadoc markup?

* impact - field name deduplication becomes slightly less memory-efficient, but the
* elimination of lock contention far outweighs this cost in high-concurrency scenarios.
*
* @see <a href="https://github.com/FasterXML/jackson-core/issues/332">Jackson issue on InternCache contention</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

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

Development

Successfully merging this pull request may close these issues.

3 participants