C macros for closure definitions #713
Draft
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.
Interesting experiment, not sure if it is worth it though looking at the numbers.
At risk of obfuscating code, this PR uses macros to define closure creating functions.
The upside is mostly related to less generated code:
This PR: (after warmup of running
stack testpreviously so Haskell is compiled, and then deleting.koka)stack test: 373.65s user 49.35s system 928% cpu 45.576 total
wc -l .koka/v3.1.3-test/clang-drelease/*: 1625144 total
Before:
stack test: 370.94s user 48.02s system 935% cpu 44.789 total
wc -l .koka/v3.1.3-test/clang-drelease/*: 1681567 total
~3.3% reduction in generated code.