-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NonEmpty variants of inits and tails #557
Conversation
The lazy versions use new implementations: - Lazy tails got about 10% faster. (A happy accident!) - Lazy inits got much faster: - For the first few chunks it is about 50% faster, due to better fusion. - When there are many chunks it is about 2.5x faster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff!
It looks like my original run of the Fixing the order of composition in lazy |
* Add basic benchmarks for inits/tails * Add NonEmpty variants of inits and tails The lazy versions use new implementations: - Lazy tails got about 10% faster with ghc-9.2. (A happy accident!) - Lazy inits got much faster: - For the first few chunks it is about 1.5x faster, due to better list fusion. - When there are many chunks it is about 4x faster. * Formatting and comments, as suggested in review * Add link to a relevant CLC issue about NonEmpty - haskell/core-libraries-committee#107
* Add basic benchmarks for inits/tails * Add NonEmpty variants of inits and tails The lazy versions use new implementations: - Lazy tails got about 10% faster with ghc-9.2. (A happy accident!) - Lazy inits got much faster: - For the first few chunks it is about 1.5x faster, due to better list fusion. - When there are many chunks it is about 4x faster. * Formatting and comments, as suggested in review * Add link to a relevant CLC issue about NonEmpty - haskell/core-libraries-committee#107 (cherry picked from commit d4933c6)
See #552.
The lazy versions use new implementations:
tails
got about 10% faster. (A happy accident!)inits
got much faster:The performance of the strict versions is unchanged. The
inits
benchmark with small chunks is on the slow side, taking a little over 100ms on my machine.