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

Remove Windows-specific code for static memory bounds #2326

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

alexcrichton
Copy link
Member

Added in c4e1022 I think the original
reason (which I'm not entirely knowledgeable of) may no longer be
applicable? In any case this is a significant difference on Windows from
other platforms because it makes loads/stores of wasm code have manual
checks instead of relying on the guard page, causing runtime and
compile-time slowdowns on Windows-only.

I originally rediscovered this when investigating #2318 and saw that
both the compile time of the module in question and trap information
tables were much larger than they were on Linux. Removing this
Windows-specific configuration fixed the discrepancies and afterwards
Linux and Windows were basically the same.

Added in c4e1022 I think the original
reason (which I'm not entirely knowledgeable of) may no longer be
applicable? In any case this is a significant difference on Windows from
other platforms because it makes loads/stores of wasm code have manual
checks instead of relying on the guard page, causing runtime and
compile-time slowdowns on Windows-only.

I originally rediscovered this when investigating bytecodealliance#2318 and saw that
both the compile time of the module in question and trap information
tables were much larger than they were on Linux. Removing this
Windows-specific configuration fixed the discrepancies and afterwards
Linux and Windows were basically the same.
@alexcrichton
Copy link
Member Author

cc @sunfishcode and @peterhuene, I'm not sure whether this is still needed any more, but I'm curious if y'all know more!

@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Oct 27, 2020
@whitequark
Copy link
Contributor

causing runtime and compile-time slowdowns on Windows-only.

Oh huh, so I wasn't imagining the slowdown! Thanks for fixing it.

@github-actions
Copy link

Subscribe to Label Action

cc @peterhuene

This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@peterhuene
Copy link
Member

I don't know the background to the original change as it was unfortunately before my time.

As it is referencing the page file, all I can think of is that the Windows implementation was originally allocating the memory committed instead of reserved?

I think that was the case given this old code.

@peterhuene
Copy link
Member

peterhuene commented Oct 27, 2020

Let's let @sunfishcode weigh-in before merging this as he originally added this restriction.

@sunfishcode
Copy link
Member

Looks good to me! We have much better Windows support and testing now than we did at that time, so now if we ever run out of resources, we're in a much better position now to find it and understand what's happening.

@sunfishcode sunfishcode merged commit 61f0b8f into bytecodealliance:main Oct 28, 2020
@alexcrichton alexcrichton deleted the rm-windows-case branch September 9, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants