Skip to content

perf(stdune): avoid allocations in string and path helpers - #16230

Merged
rgrinberg merged 1 commit into
ocaml:mainfrom
rgrinberg:push-uotwpxkrxnzt
Aug 28, 2026
Merged

perf(stdune): avoid allocations in string and path helpers#16230
rgrinberg merged 1 commit into
ocaml:mainfrom
rgrinberg:push-uotwpxkrxnzt

Conversation

@rgrinberg

@rgrinberg rgrinberg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Removes avoidable temporary allocations from frequently used string and path helpers. It adds option-free internal character searches, uses them in path decomposition, and constructs Filename.concat results in one pass.

The dune-action-plugin path implementation now reuses the allocation-conscious Stdune.Filename.concat. This preparatory change was split from #16224 so allocation reductions can be reviewed independently from the C-backed search optimization.

Expose unchecked string search operations for callers that use an integer sentinel, avoid intermediate search options in path operations, and allocate Filename.concat results in one pass.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
@rgrinberg
rgrinberg merged commit 307af33 into ocaml:main Aug 28, 2026
18 of 19 checks passed
@Alizter Alizter added this to the 3.25.0 milestone Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants