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.
|
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:
tailsgot about 10% faster. (A happy accident!)initsgot much faster:The performance of the strict versions is unchanged. The
initsbenchmark with small chunks is on the slow side, taking a little over 100ms on my machine.