Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] mmap/lock free allocator optimizations #102265

Merged
merged 1 commit into from
May 23, 2024
Merged

[wasm] mmap/lock free allocator optimizations #102265

merged 1 commit into from
May 23, 2024

Conversation

kg
Copy link
Member

@kg kg commented May 15, 2024

Right now on WASM we ask mmap for 16KB pages in the lock-free allocator, and mmap hands us 64KB pages that we end up wasting 3/4 of.

We also ask for zeroed pages, but we don't need zeroed pages because all of the lock-free allocator's callers memset or fully initialize their allocations anyway.

Partially fixes dotnet/perf-autofiling-issues#34303 and fixes dotnet/perf-autofiling-issues#34274

…enabled

Request non-zeroed pages from custom mmap in lock free allocator, since all of its callers memset their allocations anyway
@kg kg added the arch-wasm WebAssembly architecture label May 15, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 15, 2024
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@kg
Copy link
Member Author

kg commented May 15, 2024

According to the profiler this also makes sgen meaningfully faster at scanning roots, but I'm not sure why. Maybe it always scans complete pages so by more efficiently using pages there are less bytes for it to scan?

@kg kg merged commit 4219e45 into dotnet:main May 23, 2024
77 of 79 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
2 participants