Skip to content

Support aggregate size computations over list, maps, and structs - #1404

Merged
TristonianJones merged 3 commits into
cel-expr:masterfrom
TristonianJones:aggregate-size
Aug 15, 2026
Merged

Support aggregate size computations over list, maps, and structs#1404
TristonianJones merged 3 commits into
cel-expr:masterfrom
TristonianJones:aggregate-size

Conversation

@TristonianJones

@TristonianJones TristonianJones commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

To support best cost tracking, introduce version-aware AggregateSize methods
on list, map, and object types.

The implementations currently memoize aggregate size computations
for immutable objects. The aggregate size is capped at uint32 to minimize
the allocation overhead associated with the book-keeping fields on these
objects.

As far as possible, the allocation cost associated computing the size
list, maps, and structs has been reduced to a minimum. The purpose of
having different, or versioned, AggregateSize implementations is to allow
users to tailor which kinds of costs they're willing to consider before giving
up and assigning a maximum size.

Comment thread common/types/overflow.go
Comment thread common/types/util.go Outdated
Comment thread common/types/list.go
Comment thread common/types/util.go Outdated
l46kok
l46kok previously approved these changes Aug 14, 2026
Comment thread common/types/map.go Outdated
@TristonianJones
TristonianJones merged commit ef24047 into cel-expr:master Aug 15, 2026
8 checks passed
@TristonianJones
TristonianJones deleted the aggregate-size branch August 15, 2026 01:57
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.

2 participants