-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rewrite rules for text conversion
Closes #212. I had to add `stringToText` and `textToString` functions in order to specify inlining pragma as mentioned [here](https://gitlab.haskell.org/ghc/ghc/issues/12632). Benchmarks without rewrite rule: ``` benchmarked toText/toString time 1.013 ms (875.1 μs .. 1.148 ms) 0.819 R² (0.691 R² .. 0.904 R²) mean 1.621 ms (1.268 ms .. 2.619 ms) std dev 2.134 ms (331.2 μs .. 4.071 ms) variance introduced by outliers: 97% (severely inflated) ``` And with rewrite rule: ``` benchmarked toText/toString time 186.1 μs (183.3 μs .. 188.4 μs) 0.998 R² (0.996 R² .. 0.999 R²) mean 189.4 μs (187.7 μs .. 191.8 μs) std dev 7.508 μs (5.823 μs .. 10.36 μs) variance introduced by outliers: 20% (moderately inflated) ```
- Loading branch information
1 parent
30d348c
commit 01a9d45
Showing
4 changed files
with
53 additions
and
22 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
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