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

Contract deduplication for records #1646

Closed
Tracked by #1622
yannham opened this issue Sep 29, 2023 · 1 comment · Fixed by #1631
Closed
Tracked by #1622

Contract deduplication for records #1646

yannham opened this issue Sep 29, 2023 · 1 comment · Fixed by #1631
Assignees

Comments

@yannham
Copy link
Member

yannham commented Sep 29, 2023

Implement the contract deduplication optimization, which avoid applying many times the same contract to a field value. It seems that applying the same contract in different places (say both the framework code consuming a configuration and the configuration) is something that happens in practice, and can lead to many duplicate contracts. This is also the case for arrays lazy contracts, but we left this work for a separate issue.

We already introduced the machinery to be able to compute approximate contract equality (cf #763 #766). We were just waiting for a concrete sign that this optimization:

  1. Is needed
  2. Is efficient

#1622 provided us with a codebase to test 2., and where 1. seems to be verified.

This optimization requires that contracts are idempotent, or it could change the meaning of programs, but it's a reasonable assumption to make - even for user-defined contract. We just need to make it very clear in the documentation.

@yannham
Copy link
Member Author

yannham commented Sep 29, 2023

Close by #1631 (opened mostly for reporting and history).

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

Successfully merging a pull request may close this issue.

1 participant