Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve encoding performance by 50%.
Our use of unsafeIndex was slow because we were deconstructing the PS constructor of "digits" on every iteration through the inner loop. Boo! By manually allocating a Ptr and marking it as strict, we can get GHC to hoist the case analysis of the Ptr constructor to the outside of the loop, and thereby win.
- Loading branch information
Showing
1 changed file
with
12 additions
and
8 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