Repository navigation
perf: format small embedded text on the thread of the plugin - #1485
Merged
Merged
Conversation
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.
When a Wasm plugin formatted embedded text with another plugin, the request went to the runtime's thread and then to another plugin's thread and back. The thread formatting a batch of files now keeps its own instance of the embedded text's plugin and calls it directly.
This is only done for text up to 64KB (handing over larger text costs little compared to formatting it) and one level deep. Everything else goes through the runtime as before: process plugins, plugins whose configuration was not checked yet, when the embedded text needs to be made stable, and when the plugin panics or runs out of stack.
Both instances run on the same native stack, and each may use up to 8MB of it. The thread's stack stays at 11MB, and it goes through the runtime when not enough is left. Plugins had used at most 118KB out of the 2MB they may use when measuring real ones with deeply nested documents (ex. 200 nested
<div>s).Things to know:
Synthetic benchmarks with plugins that do little work on Linux: