Skip to content

Switch to direct observation of costs on a per-operation basis - #1430

Open
TristonianJones wants to merge 1 commit into
cel-expr:masterfrom
TristonianJones:call-observer
Open

Switch to direct observation of costs on a per-operation basis#1430
TristonianJones wants to merge 1 commit into
cel-expr:masterfrom
TristonianJones:call-observer

Conversation

@TristonianJones

Copy link
Copy Markdown
Collaborator

Updates to the way costs are observed to reduce allocations an inefficiencies.

Benchmark Master HEAD Direct Push (Observerless) Delta
simple_comparison 300.0 ns / 550 B / 10 allocs 205.1 ns / 224 B / 4 allocs -31.6% latency, -59.3% memory, -60.0% allocs
function_calls 549.3 ns / 798 B / 14 allocs 355.6 ns / 288 B / 7 allocs -35.3% latency, -63.9% memory, -50.0% allocs
comprehension 11,829 ns / 7,748 B / 148 allocs 7,583 ns / 5,188 B / 131 allocs -35.9% latency, -33.0% memory, -11.5% allocs
nested_comprehensions 14,484 ns / 4,956 B / 250 allocs 7,357 ns / 3,340 B / 106 allocs -49.2% latency (~2x faster), -32.6% memory, -57.6% allocs

@TristonianJones
TristonianJones force-pushed the call-observer branch 2 times, most recently from 9c3db5a to 1a033dc Compare August 21, 2026 00:56
Comment thread ext/encoders_test.go
},
estimatedCost: checker.CostEstimate{Min: 2, Max: math.MaxUint64},
actualCost: 1,
actualCost: math.MaxUint64,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The fact that this wasn't 1 was actually a bug.

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.

1 participant