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

Avoid copying constraints for attribute schemas #426

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Nov 14, 2024

Constraints are immutable after construction by convention, so we can achieve performance improvements by avoiding creating an extra copy each time.

Impact

On deeply nested attribute schemas, we're seeing a lot of extra copy operations
CleanShot 2024-11-13 at 14 16 00@2x

By avoiding copying the constraints, we can cut off the tail
CleanShot 2024-11-14 at 12 11 58@2x

Constraints are immutable after construction by convention
@dbanck dbanck added the enhancement New feature or request label Nov 14, 2024
@dbanck dbanck requested a review from a team as a code owner November 14, 2024 11:32
Copy link
Member

@ansgarm ansgarm left a comment

Choose a reason for hiding this comment

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

@dbanck dbanck merged commit 9d252ff into main Nov 15, 2024
5 checks passed
@dbanck dbanck deleted the f-improve-copy-performance branch November 15, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants