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

Track sizes of comprehension results #901

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

jpbetz
Copy link
Collaborator

@jpbetz jpbetz commented Feb 27, 2024

Setting this as draft because I'm not convinced it's entirely correct. It's assuming that the result size of a comprehension matches the iteration. Does this miscount break .filter(), .exists() ...?

Fixes #900

@jpbetz jpbetz force-pushed the fix-comprehension-chain-cost branch from d422885 to d76e4fb Compare February 27, 2024 21:53
@jpbetz jpbetz force-pushed the fix-comprehension-chain-cost branch from d76e4fb to 030abf1 Compare February 27, 2024 23:14
@jpbetz jpbetz marked this pull request as ready for review February 27, 2024 23:15
@jpbetz
Copy link
Collaborator Author

jpbetz commented Feb 27, 2024

@TristonianJones would you be willing to review?

Any problem test cases you can think of would be really helpful.
You'd mentioned a few additional places where we might need to track size, I had trouble isolating them but if you see any let me know.

@jpbetz jpbetz force-pushed the fix-comprehension-chain-cost branch from 030abf1 to 4464b6a Compare February 28, 2024 00:40
checker/cost_test.go Show resolved Hide resolved
checker/cost_test.go Show resolved Hide resolved
@jpbetz jpbetz force-pushed the fix-comprehension-chain-cost branch from 4464b6a to 2623387 Compare February 28, 2024 01:26
@jpbetz jpbetz force-pushed the fix-comprehension-chain-cost branch from 2623387 to da2e69e Compare February 28, 2024 01:32
@jpbetz jpbetz merged commit 13b3d56 into google:master Feb 28, 2024
2 checks passed
jpbetz added a commit to jpbetz/cel-go that referenced this pull request Feb 28, 2024
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.

Estimated size information lost when .map() result is chained
3 participants