-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaks to make tight arithmetic loops behave better on the JIT
- Apparently `(max 0 n)` used in `Nat.drop` was slow, so it's been replaced with something that should act the same on natural numbers. - Switched back to the original currying macro behavior. This seems to optimize better in various ways. According to my tests, it should only really be necessary for recursive functions, and so I've added some capabilities to only apply the full macro locally on those. But the racket optimizer also seems very fickle, so using predefined curry functions on various builtins seems to _not_ optimize properly like they do in my localized tests, even when various inlining suggestions are enabled. Hopefully this can be fixed in the future as it makes compile times significantly worse. This also fixes a latent bug where there wouldn't be enough pre-defined currying functions for procedures that take more than 20 arguments. I've instead lowered the predefined functions to a maximum of 9 arguments, and made anything over that just use the macro directly, since those are presumably rare. None of the currying functions are currently used, but hopefully they can be in the future.
- Loading branch information
Showing
3 changed files
with
90 additions
and
52 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
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