Optimisations for the garbage collectors
What does this MR do?
- When copying nodes to the other semi-space in the Wasm garbage collector, copy nodes without pointers to the end of the new space. This way we don't have to walk through them while searching for more nodes to copy. (The C implementation for this was done elsewhere already.)
- Restructure the control flow for both garbage collectors to only check for built-in types (
INT
etc.) when the arity is 0. This speeds up things when the node is not a built-in, because we only need to do an arity check. - Check for
_STRING_
sooner in both garbage collectors because it is so common.
Related issues
Closes #90 (closed).
Changes to public APIs
N/A
Author's checklist (required)
See CONTRIBUTING.md for the rationale behind these items:
-
The commit history does not contain merges (use git rebase -i master
if it does) -
Intermediate commits compile (use git rebase -i master
if not) -
Newly added code has a style consistent with the existing code -
Newly added code is documented -
A changelog entry has been added if required. See CONTRIBUTING.md -
If bugs have been solved, tests have been added -
Appropriate types have been used, especially in APIs -
If efficiency is part of the acceptance criteria of the issue, a benchmark is provided -
If enum instruction
in src/abc_instructions.h has changed,ABC_VERSION
in src/settings.h has been increased
Edited by Camil Staps