Qi/  Racket Competitive Benchmarks
1 General Information
1.1 Profile:   github
1.2 System Information
2 Summary Results
3 Detailed Results
3.1 filter-map
3.2 filter-map-foldl
3.3 range-filter-map-filter-map-foldl
3.4 range-map-car
8.11.1

Qi/Racket Competitive Benchmarks

1 General Information

Date and time: Fri Jan 12 17:08:50+0100 2024

1.1 Profile: github

Logarithmic/Linear boundary: 10000

Number of measurements for each input length: 100

Garbage collection: step

1.2 System Information

Operating System: linux

Architecture: x86_64

Runtime: chez-scheme

Machine: Linux backup.local 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64

Racket Version: 8.11.1 Welcome to Racket v8.11.1 [cs].

2 Summary Results

Benchmark

Qi/Racket

filter-map

0.656362

filter-map-foldl

0.213866

range-filter-map-filter-map-foldl

0.363228

range-map-car

0.000016

3 Detailed Results

Benchmarks took 3514.6 seconds (0:58:34).

Measured lengths: (10 20 30 40 50 60 70 80 90 100 200 300 400 500 600 700 800 900 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000 110000 120000 130000 140000 150000 160000 170000 180000 190000 200000 210000 220000 230000 240000 250000 260000 270000 280000 290000 300000 310000 320000 330000 340000 350000 360000 370000 380000 390000 400000 410000 420000 430000 440000 450000 460000 470000 480000 490000 500000 510000 520000 530000 540000 550000 560000 570000 580000 590000 600000 610000 620000 630000 640000 650000 660000 670000 680000 690000 700000 710000 720000 730000 740000 750000 760000 770000 780000 790000 800000 810000 820000 830000 840000 850000 860000 870000 880000 890000 900000 910000 920000 930000 940000 950000 960000 970000 980000 990000 1000000)

3.1 filter-map

Benchmark took 992.4 seconds (0:16:32).
Qi:

(flow (~>> (filter odd?) (map sqr)))

Racket:
(lambda (v)
  (map sqr
       (filter odd? v)))
for/list:
(lambda (lst)
  (for/list ((v lst)
             #:when (odd? v))
    (sqr v)))
in-list:
(lambda (lst)
  (for/list ((v (in-list lst))
             #:when (odd? v))
    (sqr v)))
\begin{alignat*}{5}\text{Qi:}\quad t & = & & 0.000017x^2 & {}+{} & 19.868521x & {}+{} & 139177.715454\\ \text{Racket:}\quad t & = & & 0.000022x^2 & {}+{} & 32.688731x & {}-{} & 193475.264627\\ \text{for/list:}\quad t & = & & 0.000009x^2 & {}+{} & 37.798980x & {}-{} & 82453.642431\\ \text{in-list:}\quad t & = & & 0.000010x^2 & {}+{} & 21.263928x & {}-{} & 79490.188420\end{alignat*}

Qi

Racket

for/list

in-list

Qi

1.000000

0.656362

0.754720

1.163958

Racket

1.523548

1.000000

1.149853

1.773346

for/list

1.324994

0.869676

1.000000

1.542237

in-list

0.859138

0.563906

0.648409

1.000000

\frac{Q}{R}(x)=12.363765x^{-1}+0.680564

3.2 filter-map-foldl

Benchmark took 631.7 seconds (0:10:31).
Qi:

(flow (~>> (filter odd?) (map sqr) (foldl + 0)))

Racket:
(lambda (v)
  (foldl + 0
         (map sqr
              (filter odd? v))))
for/sum:
(lambda (v)
  (for/sum ([i (in-list v)]
            #:when (odd? i))
    (sqr i)))
\begin{alignat*}{5}\text{Qi:}\quad t & = & & & & 14.519397x & {}-{} & 14515.206469\\ \text{Racket:}\quad t & = & & 0.000026x^2 & {}+{} & 45.126300x & {}-{} & 290079.734851\\ \text{for/sum:}\quad t & = & & & & 13.845183x & {}-{} & 13441.084425\end{alignat*}

Qi

Racket

for/sum

Qi

1.000000

0.213866

1.050366

Racket

4.675828

1.000000

4.911329

for/sum

0.952049

0.203611

1.000000

\frac{Q}{R}(x)=14.513103x^{-1}+0.303436

3.3 range-filter-map-filter-map-foldl

Benchmark took 1267.4 seconds (0:21:07).
Qi:
(flow (~>> range
           (filter odd?)
           (map sqr)
           (filter (lambda (v) (< (remainder v 10) 5)))
           (map (lambda (v) (* v 2)))
           (foldl + 0)))
Racket:
(lambda (v)
  (foldl + 0
         (map (λ (v) (* 2 v))
              (filter (λ (v) (< (remainder v 10) 5))
                      (values
                       (map sqr
                            (filter odd?
                                    (range 0 v))))))))
for*/sum:
(lambda (v)
  (for*/sum ([i (in-range v)]
             #:when (odd? i)
             [j (in-value (sqr i))]
             #:when (< (remainder j 10) 5))
    (* j 2)))
\begin{alignat*}{5}\text{Qi:}\quad t & = & & & & 56.744585x & {}+{} & 1945.154241\\ \text{Racket:}\quad t & = & & 0.000059x^2 & {}+{} & 99.586993x & {}-{} & 708432.587424\\ \text{for*/sum:}\quad t & = & & & & 24.673059x & {}-{} & 153.003683\end{alignat*}

Qi

Racket

for*/sum

Qi

1.000000

0.363228

2.268745

Racket

2.753094

1.000000

6.246067

for*/sum

0.440772

0.160101

1.000000

\frac{Q}{R}(x)=8.600671x^{-1}+0.525792

3.4 range-map-car

Benchmark took 623.1 seconds (0:10:23).
Qi:

(flow (~>> range (map sqr) car))

Racket:
(lambda (v)
  (car
   (map sqr
        (range 0 v))))
for/first:
(lambda (v)
  (for/first ([i (in-range v)])
    (sqr i)))
\begin{alignat*}{5}\text{Qi:}\quad t & = & & & {}-{} & 0.000032x & {}+{} & 1607.456933\\ \text{Racket:}\quad t & = & & 0.000043x^2 & {}+{} & 63.225583x & {}-{} & 676536.923253\\ \text{for/first:}\quad t & = & & & & 0.000010x & {}+{} & 368.984760\end{alignat*}

Qi

Racket

for/first

Qi

1.000000

0.000016

4.366013

Racket

63408.118263

1.000000

276840.673203

for/first

0.229042

0.000004

1.000000

\frac{Q}{R}(x)=20.491968x^{-1}+0.017873