Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up setup of NativeCall subs and reduce memory usage
When replacing a native sub's stub body with a generated one, we need to remove the scheduled fixups, lest they undo our replacement. The easiest way to do this is to just run the compiler thunk, which takes care of this after dynamic compilation. This however is a very expensive operation as it not only compiles that body but has to create setup code for the lexical scope. This makes compiling a computation unit containing native subs scale O(n^2) with the number of native subs in the lexical scope. We can avoid this by doing a more targeted removal of the stub code. This speeds up compiling a comp unit containing some 3K native subs from almost 5 minutes to just 2 1/2 minutes and reduces memory usage from 16 GiB to 8 GiB.
- Loading branch information
Showing
2 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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