Update and document Emscripten link-time options#174
Merged
mpwarres merged 7 commits intoproxy-wasm:mainfrom Mar 4, 2025
Merged
Update and document Emscripten link-time options#174mpwarres merged 7 commits intoproxy-wasm:mainfrom
mpwarres merged 7 commits intoproxy-wasm:mainfrom
Conversation
Set INITIAL_HEAP=1MB and ALLOW_MEMORY_GROWTH=1 to reduce starting memory usage of plugins, but allow the heap to grow. Explicitly set STACK_SIZE (previously named TOTAL_STACK) to 1MiB. This is a middle ground between Emscripten's default value prior to 3.1.27 of 5MiB and its default value since then of 64KiB. Also add comments documenting the purpose of each link-time option. Signed-off-by: Michael Warres <[email protected]>
martijneken
reviewed
Oct 12, 2024
PiotrSikora
reviewed
Oct 12, 2024
martijneken
requested changes
Nov 14, 2024
Contributor
martijneken
left a comment
There was a problem hiding this comment.
Let's move this PR forward? Please add the same link-time options to the Makefile:
Line 40 in a982ad0
Signed-off-by: Michael Warres <[email protected]>
- Reduce STACK_SIZE to 256KB - Update Makefile to be in sync with Bazel build rule Signed-off-by: Michael Warres <[email protected]>
Contributor
Author
Done. PTAL again, thanks! |
- Remove STACK_SIZE override, and instead use Emscripten default of 64KB - Change INITIAL_HEAP to 64KB Signed-off-by: Michael Warres <[email protected]>
actions/cache@v1 is no longer supported: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down Signed-off-by: Michael Warres <[email protected]>
Signed-off-by: Michael Warres <[email protected]>
Contributor
Author
|
Updated to remove the explicit settings of STACK_SIZE (so default 64KB is used), and reduce INITIAL_HEAP to 64KB. PTAL again, thanks! |
martijneken
approved these changes
Mar 4, 2025
Signed-off-by: Michael Warres <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set INITIAL_HEAP=64KB and ALLOW_MEMORY_GROWTH=1 to reduce starting memory usage of plugins, but allow the heap to grow. Use default Emscripten STACK_SIZE of 64KB, see this emscripten-discuss thread for background behind that value.
Also add comments documenting the purpose of each link-time option.