Skip to content

perf: Avoid intermediate allocations in nominal_obligations [-0.28%] - #75

Draft
xmakro wants to merge 1 commit into
perf/base-0713from
perf/wf-nominal-obligations
Draft

perf: Avoid intermediate allocations in nominal_obligations [-0.28%]#75
xmakro wants to merge 1 commit into
perf/base-0713from
perf/wf-nominal-obligations

Conversation

@xmakro

@xmakro xmakro commented Jul 31, 2026

Copy link
Copy Markdown
Owner

WfPredicates::nominal_obligations built a per-predicate Vec of origins and a fully instantiated InstantiatedPredicates as intermediates before collecting the result. Walk the parent chain into an inline SmallVec and instantiate each level directly into a presized result with instantiate_own, so a call allocates just the returned obligations.

The trace! in this function now logs the built obligations rather than the instantiated predicates, because the intermediate it used to print no longer exists.

@xmakro
xmakro force-pushed the perf/wf-nominal-obligations branch from 38427be to a255c2a Compare July 31, 2026 09:18
@xmakro
xmakro force-pushed the perf/wf-nominal-obligations branch from a255c2a to ba60431 Compare July 31, 2026 09:37
@xmakro xmakro changed the title perf: Avoid intermediate allocations in nominal_obligations perf: Avoid intermediate allocations in nominal_obligations [-0.28%] Aug 1, 2026
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