Skip to content

Env copy on write - #1405

Merged
TristonianJones merged 8 commits into
cel-expr:masterfrom
TristonianJones:env-copy-on-write
Aug 7, 2026
Merged

Env copy on write#1405
TristonianJones merged 8 commits into
cel-expr:masterfrom
TristonianJones:env-copy-on-write

Conversation

@TristonianJones

Copy link
Copy Markdown
Collaborator

Introduce copy-on-write semantics for checker/env.go

Closes #1398

| Benchmark Case | Before (ns/op) | After (ns/op) | Δ Time | Before (B/op) | After (B/op) | Δ Memory | Before (allocs) | After (allocs) | Δ Allocs |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| BenchmarkProgramPlan/Default | 8,153 | 930 | **-88.6%** | 8,320 | 1,416 | **-83.0%** | 36 | 26 | **-27.8%** |
| BenchmarkProgramPlan/OptimizeUnneeded | 7,344 | 1,150 | **-84.3%** | 8,784 | 1,512 | **-82.8%** | 50 | 32 | **-36.0%** |
| BenchmarkProgramPlan/OptimizeNeeded | 8,370 | 2,164 | **-74.1%** | 10,224 | 2,976 | **-70.9%** | 67 | 52 | **-22.4%** |
@TristonianJones
TristonianJones requested a review from l46kok August 6, 2026 23:17
Comment thread checker/scopes.go
Comment thread cel/env.go Outdated
@TristonianJones

Copy link
Copy Markdown
Collaborator Author

Done, PTAL.

Comment thread cel/env.go Outdated
@TristonianJones
TristonianJones merged commit 2cf1626 into cel-expr:master Aug 7, 2026
8 checks passed
@TristonianJones
TristonianJones deleted the env-copy-on-write branch August 7, 2026 20:33
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.

Env.Extend deep-copies environment state that is almost always identical to the parent's

2 participants