-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
I'm not a huge fan of the way we implement unordered folds. The compiler has no clue what they're up to, so optimization is garbage. I experimented with using an operation
viewU :: BinomHeap a -> Maybe (a, BinomHeap a)which extracts the root of the first binomial tree, to implement foldlU'.
Unfortunately, the performance was worse than what we do now. But I wonder if things might change if we work in bigger chunks. For starters, something like
viewU2 :: BinomForest (Succ Zero) a -> Maybe (a, a, BinomForest (Succ Zero) a)Working with two elements at once should reduce the churn in the low bits, and might give this technique some hope.
Reactions are currently unavailable