[erlang-questions] Question about reverse list of recursion functions

Jesper Louis Andersen <>
Fri Jan 1 16:14:03 CET 2016


On Mon, Dec 28, 2015 at 7:31 PM, Joe Armstrong <> wrote:

> As an additional exercise you should measure and compare with lists:sort
>

This is a sneak-peak on this years christmas-hacking project, eministat,
which is a benchmarking tool for Erlang. It's ASCII art does require you to
use a fixed width font when viewing the output however. The results are:

* lists:sort/1 (#) is significantly faster than everything else.
* sortl (x) and sortx (%) has no provable difference
* sortf (+) and sortfl (*) are significantly slower than sortl (x)

I'll write a more complete announcement when things are cleaned up a bit
more later on.

15> qsort_eministat:t().
x sortl
+ sortf
* sortfl
% sortx
# lists:sort/1
+--------------------------------------------------------------------------+
|##                                ###x                  ***        +++ +++|
|##                                ##xx                   **         ++ +++|
|##                                x#xx                   **         ++ ++ |
|##                                x#x                    **         ++ +  |
|##                                x#x                    **         ++ +  |
|##                                x#x                    **         ++ +  |
|##                                x#x                    **         ++ +  |
|##                                x#                     **         ++ +  |
|##                                 #                     *           + +  |
|##                                 #                     *           + +  |
|#                                  #                     *           + +  |
|#                                  #                     *           + +  |
|#                                  #                     *           + +  |
|#                                  #                     *           + +  |
|#                                  #                     *           + +  |
|#                                  #                     *           + +  |
|#                                  #                     *           + +  |
|#                                  #                     *             +  |
|#                                  #                     *             +  |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  #                     *                |
|#                                  %                     *                |
|#                                  %                     *                |
|#                                  %                     *                |
|#                                  %                     *                |
|#                                  %                     *                |
|#                                  %                     *                |
|#                                  %                     *                |
|#                                  %                     *                |
|                                  |A|                                     |
|                                                                     MA|  |
|                                                         A|               |
|                                  |A                                      |
|A|                                                                        |
+--------------------------------------------------------------------------+
Dataset: x N=50 CI=95.0000
Statistic     Value     [         Bias] (Bootstrapped LB‥UB)
Min:            47.0000
1st Qu.         48.0000
Median:         48.0000
3rd Qu.         48.0000
Max:            50.0000
Average:        48.1000 [  -2.66000e-4] (      47.9000 ‥       48.3000)
Std. Dev:      0.735402 [  -1.34737e-2] (     0.580288 ‥      0.932191)

Outliers: 8/10 = 18 (μ=48.0997, σ=0.721928)
        Outlier variance:    1.96000e-2 (slight)

------

Dataset: + N=50 CI=95.0000
Statistic     Value     [         Bias] (Bootstrapped LB‥UB)
Min:            74.0000
1st Qu.         76.0000
Median:         76.0000
3rd Qu.         77.0000
Max:            79.0000
Average:        76.4200 [  -6.32000e-4] (      76.1200 ‥       76.6800)
Std. Dev:       1.03194 [  -1.54531e-2] (     0.852607 ‥       1.29363)

Outliers: 1/2 = 3 (μ=76.4194, σ=1.01649)
        Outlier variance:    1.96000e-2 (slight)

Difference at 95.0% confidence
        28.3200 ± 0.355542
        58.8773% ± 0.739172%
        (Student's t, pooled s = 0.896023)
------

Dataset: * N=50 CI=95.0000
Statistic     Value     [         Bias] (Bootstrapped LB‥UB)
Min:            65.0000
1st Qu.         66.0000
Median:         66.0000
3rd Qu.         66.0000
Max:            67.0000
Average:        66.1400 [  -2.14000e-4] (      66.0200 ‥       66.2400)
Std. Dev:      0.404566 [  -8.32260e-3] (     0.303046 ‥      0.520596)

Outliers: 1/8 = 9 (μ=66.1398, σ=0.396243)
        Outlier variance:    1.96000e-2 (slight)

Difference at 95.0% confidence
        18.0400 ± 0.235502
        37.5052% ± 0.489608%
        (Student's t, pooled s = 0.593502)
------

Dataset: % N=50 CI=95.0000
Statistic     Value     [         Bias] (Bootstrapped LB‥UB)
Min:            47.0000
1st Qu.         48.0000
Median:         48.0000
3rd Qu.         48.0000
Max:            49.0000
Average:        47.9800 [  -2.34000e-4] (      47.8800 ‥       48.0200)
Std. Dev:      0.246610 [  -1.61201e-2] (   0.00000e+0 ‥      0.377424)

Outliers: 2/1 = 3 (μ=47.9798, σ=0.230490)
        Outlier variance:    1.96000e-2 (slight)

No difference proven at 95.0% confidence
------

Dataset: # N=50 CI=95.0000
Statistic     Value     [         Bias] (Bootstrapped LB‥UB)
Min:            20.0000
1st Qu.         20.0000
Median:         20.0000
3rd Qu.         20.0000
Max:            21.0000
Average:        20.2000 [  -5.00000e-5] (      20.1000 ‥       20.3000)
Std. Dev:      0.404061 [  -6.49526e-3] (     0.303046 ‥      0.462910)

Outliers: 0/10 = 10 (μ=20.1999, σ=0.397566)
        Outlier variance:    7.50015e-2 (slight)

Difference at 95.0% confidence
        -27.9000 ± 0.235433
        -58.0042% ± 0.489467%
        (Student's t, pooled s = 0.593330)
------

ok


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160101/11f11034/attachment.html>


More information about the erlang-questions mailing list