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

List append optimizations for comprehension loops #491

Merged
merged 1 commit into from
Feb 22, 2022

Conversation

TristonianJones
Copy link
Collaborator

@TristonianJones TristonianJones commented Feb 22, 2022

Introduce the list append optimizations used within C++ to ensure that comprehensions are able to treat internal
CEL variables as mutable for the purposes of list construction. Closes #488

Before the optimization:

BenchmarkContextEval-8   	     250	   4680999 ns/op	   43948 B/op	    1323 allocs/op

After the optimization:

BenchmarkContextEval-8   	   10233	    116829 ns/op	   35516 B/op	    1038 allocs/op

The memory usage is not that different between the before and after, but the overall evaluation time (117us vs. 4.58ms) represents a 40x improvement in evaluation speed which will significantly help comprehension-heavy uses of CEL with even moderately sized inputs.

Copy link
Collaborator

@jnthntatum jnthntatum left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Poor performance of concatList Value() method
2 participants