-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add INLINABLE pragmas to most overloaded combinators
This adds INLINABLE pragmas to most exported combinators, which enables cross-module specialization of the Stream constraint (which can in turn enable further optimizations). This improves performance of these combinators in scenarios where GHC chooses not to inline them, since they may still be specialized instead. This change is primarily in response to a performance regression discovered by the GHC performance test suite when running haddock (since haddock uses parsec). The full discussion is available here: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3041 The gist is that, without these pragmas, performance relies too heavily on inlining heuristics working out in our favor, and subtle changes in the optimizer can cause regressions. The GHC performance tests suggest this patch reliably reduces runtime of haddock on base by 7–9% and allocation by 3–5%. Pretty good for doing something so simple!
- Loading branch information
1 parent
6bcde81
commit ce41699
Showing
5 changed files
with
49 additions
and
0 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
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