Skip to content

perf(stdune): avoid allocation in Nonempty_list.last - #81

Closed
anmonteiro wants to merge 1 commit into
mainfrom
perf/nonempty-list-last
Closed

perf(stdune): avoid allocation in Nonempty_list.last#81
anmonteiro wants to merge 1 commit into
mainfrom
perf/nonempty-list-last

Conversation

@anmonteiro

Copy link
Copy Markdown
Owner

Return the final element of a non-empty list directly instead of allocating an intermediate option.

A local benchmark removes two minor-heap words per call for lists longer than one element. The benchmark harness is not included.

Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
@anmonteiro
anmonteiro force-pushed the perf/nonempty-list-last branch from 8391b52 to 31c55b0 Compare August 21, 2026 22:44
@anmonteiro

Copy link
Copy Markdown
Owner Author

Superseded by ocaml#16088.

@anmonteiro anmonteiro closed this Aug 22, 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.

1 participant