Skip to content

Native raw pointer traversal for NativeType values - #1515

Merged
TristonianJones merged 3 commits into
cel-expr:masterfrom
TristonianJones:native-rawptr
Sep 28, 2026
Merged

TristonianJones merged 3 commits into
cel-expr:masterfrom
TristonianJones:native-rawptr

Conversation

@TristonianJones

Copy link
Copy Markdown
Collaborator

Improve performance of CEL's native type handling by supporting raw pointer traversal

Notably, the performance improves considerably:

Feature / Operation Legacy CEL-Go (Reflection) Third-Party Fast Adapter Present CEL-Go (native-rawptr)
Primitive Field Access (msg.Int64Val == 10) ~390 ns / 5 allocs ~100–120 ns / 1–2 allocs 100.4 ns / 1 alloc (16 B)
Pointer Field Access (msg.PtrString == 'val') ~270 ns / 3 allocs ~80–110 ns / 1–2 allocs 61.3 ns / 1 alloc (16 B)
Field Presence Testing (has(msg.Field)) ~320 ns / 4 allocs ~160–200 ns / 0–1 allocs 85.6 – 155.5 ns / 0 allocs (0 B)
Nested Struct Access (msg.Nested.Field) ~580 ns / 8 allocs ~140–180 ns / 2–3 allocs 125.2 ns / 2 allocs (32 B)
Nested Struct Presence (has(msg.Nested.Field)) ~440 ns / 6 allocs ~200–240 ns / 0–1 allocs 169.9 ns / 0 allocs (0 B)
Comprehension on Slice (msg.Slice.all(...)) ~980 ns / 12 allocs ~550–700 ns / 2–4 allocs 495.7 ns / 1 alloc (64 B)

@TristonianJones
TristonianJones merged commit 0424fd3 into cel-expr:master Sep 28, 2026
8 checks passed
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