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

Optimized Jackson Deserialization for Optimized List of Primitives #2431

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

bmarcaur
Copy link
Member

Before this PR

Comment that inspired this work: #2389 (comment)

Previously, Jackson deserialization would pass through a generated setter leveraging an Iterable<Type> which inherently boxes the type to ultimately unbox while storing it in the optimized storage.

After this PR

This changes simply moves the JacksonSetter to the non box'd setter for these optimized situations.

@@ -601,11 +601,12 @@ private Iterable<MethodSpec> createSetters(
Map<com.palantir.conjure.spec.TypeName, TypeDefinition> typesMap,
boolean override,
boolean strict) {
Collection<MethodSpec> setters = Lists.newArrayListWithExpectedSize(fields.size());
// Each field tends to fan out into many setters
Copy link
Contributor

Choose a reason for hiding this comment

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

This is only true of container types (optional/set/list), not standard fields. Difficult to tell whether a 5x multiplier is ideal or not, but probably not worth spending much time optimizing

Copy link
Contributor

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

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

Nice!

@bulldozer-bot bulldozer-bot bot merged commit 22b3ac3 into develop Jan 13, 2025
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the bmarcaurele/deser-optimization branch January 13, 2025 15:02
@autorelease3
Copy link

autorelease3 bot commented Jan 13, 2025

Released 8.37.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.

3 participants