Skip to content

perf: avoid copying the attribute map in readAttributes - #99

Open
andreaTP wants to merge 1 commit into
mainfrom
perf/cheaper-attribute-maps
Open

andreaTP wants to merge 1 commit into
mainfrom
perf/cheaper-attribute-maps

Conversation

@andreaTP

Copy link
Copy Markdown

Size the result map for a full view and wrap it instead of copying it with Map.copyOf.

readAttributes("unix:*"): 1816 -> 1240 B/op, ~1.95 -> ~1.25 µs/op (JDK 21, benchmark from #97, interleaved runs).

Checked with Endive (wasi-tests, machine-tests, wabt, Zig stdlib suite): no regressions.

Size the result map for a full view and wrap it instead of copying it.
readAttributes("unix:*") allocates 32% less (1816 -> 1240 B/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