Skip to content

perf: Allow fields to be skipped when the schema defines an member that is not found on the target type#367

Open
PauloHMattos wants to merge 2 commits intoch-robinson:mainfrom
PauloHMattos:perf-ignore-fields
Open

perf: Allow fields to be skipped when the schema defines an member that is not found on the target type#367
PauloHMattos wants to merge 2 commits intoch-robinson:mainfrom
PauloHMattos:perf-ignore-fields

Conversation

@PauloHMattos
Copy link
Copy Markdown
Contributor

Implements the approach suggested in #342 (comment)
to optimize deserialization when the schema contains more fields than the target type.

I couldn’t think of a reasonable way to write tests that ensure the skip-field code path is executed. If you have any suggestions, I’m all ears.

If I’m missing something, please let me know and I’ll address it right away.

Closes #342

@PauloHMattos
Copy link
Copy Markdown
Contributor Author

cc @fabianoliver

Copy link
Copy Markdown
Member

@dstelljes dstelljes left a comment

Choose a reason for hiding this comment

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

Sorry for the wait! This looks good; just one concern about custom cases

Comment on lines +69 to +71
// field skipping (must be first):
builder => new BinarySkipFieldDeserializerBuilderCase(builder),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this needs to be first, it might be best to handle SkipField directly in BuildExpression rather than implementing it as a case. Projects with custom cases tend to Prepend onto the defaults (like in our examples)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just pushed the change to handle this directly in BuildExpression. Let me know if is all good now

@PauloHMattos
Copy link
Copy Markdown
Contributor Author

@dstelljes any feedback on this?

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.

Deserialisers should be able to skip fields

2 participants