-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make foldr and foldl short-circuit instead of lazily accumulating thunks. * Switch to a non-empty style to avoid unnecessary comparisons. This also helps GHC with arity-analysis (somehow), which greatly improves performance of CPS-style foldr and foldl. * Change the bitwise operations used from bitmask = bm .&. -bm; bi = ctz bitmask; bm' = bm `xor` bitmask to bi = ctz bm; bm' = bm .&. (bm-1) which is slightly faster.
- Loading branch information
Showing
3 changed files
with
55 additions
and
51 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