Skip to content

Use new Tree functions internally - #1246

Merged
meooow25 merged 1 commit into
haskell:masterfrom
meooow25:use-tree-folds
Sep 4, 2026
Merged

Use new Tree functions internally#1246
meooow25 merged 1 commit into
haskell:masterfrom
meooow25:use-tree-folds

Conversation

@meooow25

Copy link
Copy Markdown
Contributor

Closes #1244

@meooow25

meooow25 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Benchmarks with GHC 9.14:

Name                                         Time - - - - - - - -    Allocated - - - - -
                                                  A       B     %         A       B     %
bcc.line,n=100                               3.7 μs  3.7 μs   +0%     49 KB   49 KB   +0%
bcc.line,n=1000000                           323 ms  326 ms   +0%    632 MB  632 MB   +0%
bcc.maxDAG,n=15                              778 ns  779 ns   +0%    7.2 KB  7.2 KB   +0%
bcc.maxDAG,n=1500                            6.6 ms  7.3 ms   +9%    748 KB  748 KB   +0%
bcc.rand,n=100,m=1000                        6.1 μs  6.1 μs   +0%     44 KB   44 KB   +0%
bcc.rand,n=100,m=10000                        53 μs   53 μs   +1%     45 KB   45 KB   +0%
bcc.rand,n=10000,m=100000                    2.8 ms  3.0 ms   +7%    5.4 MB  5.4 MB   +0%
bcc.rand,n=100000,m=1000000                   54 ms   54 ms   -1%     54 MB   54 MB   +0%
bcc.star,n=100                               3.1 μs  3.1 μs   +0%     48 KB   48 KB   +0%
bcc.star,n=1000000                            74 ms  116 ms  +55%    489 MB  489 MB   +0%
scc.line,n=100                               2.4 μs  2.2 μs   -7%     29 KB   24 KB  -18%
scc.line,n=1000000                           175 ms  178 ms   +2%    330 MB  277 MB  -16%
scc.maxDAG,n=15                              863 ns  836 ns   -3%    8.0 KB  7.2 KB  -10%
scc.maxDAG,n=1500                             39 ms   41 ms   +3%     43 MB   43 MB   +0%
scc.rand,n=100,m=1000                        7.8 μs  7.6 μs   -2%     64 KB   59 KB   -8%
scc.rand,n=100,m=10000                        83 μs   85 μs   +1%    416 KB  410 KB   -1%
scc.rand,n=10000,m=100000                    3.8 ms  3.9 ms   +2%    7.5 MB  7.2 MB   -4%
scc.rand,n=100000,m=1000000                  116 ms  110 ms   -5%     75 MB   72 MB   -4%
scc.star,n=100                               2.4 μs  2.2 μs   -7%     29 KB   24 KB  -18%
scc.star,n=1000000                           193 ms  170 ms  -11%    330 MB  277 MB  -16%
stronglyConnCompR.line,n=100                 6.2 μs  6.1 μs   -2%     60 KB   55 KB   -9%
stronglyConnCompR.line,n=1000000             402 ms  386 ms   -3%    628 MB  574 MB   -8%
stronglyConnCompR.maxDAG,n=15                2.8 μs  2.7 μs   -3%     20 KB   19 KB   -4%
stronglyConnCompR.maxDAG,n=1500              113 ms  100 ms  -11%    121 MB  121 MB   +0%
stronglyConnCompR.rand,n=100,m=1000           27 μs   26 μs   -3%    160 KB  155 KB   -3%
stronglyConnCompR.rand,n=100,m=10000         496 μs  497 μs   +0%    1.1 MB  1.1 MB   +0%
stronglyConnCompR.rand,n=10000,m=100000       17 ms   17 ms   +0%     17 MB   16 MB   -2%
stronglyConnCompR.rand,n=100000,m=1000000    343 ms  355 ms   +3%    166 MB  163 MB   -2%
stronglyConnCompR.star,n=100                 6.3 μs  6.0 μs   -3%     60 KB   55 KB   -9%
stronglyConnCompR.star,n=1000000             373 ms  410 ms   +9%    628 MB  574 MB   -8%
topSort.line,n=100                           1.5 μs  1.3 μs  -13%     20 KB   14 KB  -27%
topSort.line,n=1000000                       155 ms  131 ms  -15%    254 MB  225 MB  -11%
topSort.maxDAG,n=15                          349 ns  331 ns   -5%    3.0 KB  2.2 KB  -27%
topSort.maxDAG,n=1500                        3.4 ms  3.4 ms   -1%    326 KB  243 KB  -25%
topSort.rand,n=100,m=1000                    2.8 μs  2.6 μs   -6%     20 KB   14 KB  -27%
topSort.rand,n=100,m=10000                    25 μs   28 μs  +10%     20 KB   14 KB  -27%
topSort.rand,n=10000,m=100000                1.4 ms  1.4 ms   +0%    2.4 MB  2.1 MB  -14%
topSort.rand,n=100000,m=1000000               34 ms   24 ms  -29%     24 MB   21 MB  -13%
topSort.star,n=100                           1.3 μs  1.1 μs  -14%     20 KB   14 KB  -27%
topSort.star,n=1000000                        66 ms   64 ms   -3%    215 MB  161 MB  -24%

topSort is a little better. bcc is unaffected (was regressing without #1245).

@meooow25
meooow25 merged commit dac8d82 into haskell:master Sep 4, 2026
18 of 19 checks passed
@meooow25
meooow25 deleted the use-tree-folds branch September 4, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use new Tree functions internally

1 participant