Skip to content

perf: drop grep/closure indirection in winnowNodes#557

Open
jvoisin wants to merge 1 commit into
PuerkitoBio:masterfrom
jvoisin:winnow-nodes-direct
Open

perf: drop grep/closure indirection in winnowNodes#557
jvoisin wants to merge 1 commit into
PuerkitoBio:masterfrom
jvoisin:winnow-nodes-direct

Conversation

@jvoisin
Copy link
Copy Markdown
Contributor

@jvoisin jvoisin commented May 27, 2026

In the same spirit as #545, replaces costly grep() with a loop.

While escape analysis managed to stack-allocate the per-node Selection through grep's inlining, the closure capture itself (nodes and keep) was still heap-allocated. Local benchmarks are showing a 30% allocs/op reduction, and a ~10-20% reduction in sec/op.

In the same spirit as PuerkitoBio#545, replaces costly grep() with a loop.

While escape analysis managed to stack-allocate the per-node
Selection through grep's inlining, the closure capture itself (nodes and keep)
was still heap-allocated. Local benchmarks are showing a 30% allocs/op
reduction, and a ~10-20% reduction in sec/op.
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