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
(flow (~>> (filter odd?) (map sqr)))
(lambda (v) (map sqr (filter odd? v)))
(lambda (lst) (for/list ((v lst) #:when (odd? v)) (sqr v)))
(lambda (lst) (for/list ((v (in-list lst)) #:when (odd? v)) (sqr v)))
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 |
3.2 filter-map-foldl
(flow (~>> (filter odd?) (map sqr) (foldl + 0)))
(lambda (v) (foldl + 0 (map sqr (filter odd? v))))
(lambda (v) (for/sum ([i (in-list v)] #:when (odd? i)) (sqr i)))
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 |
3.3 range-filter-map-filter-map-foldl
(flow (~>> range (filter odd?) (map sqr) (filter (lambda (v) (< (remainder v 10) 5))) (map (lambda (v) (* v 2))) (foldl + 0)))
(lambda (v) (foldl + 0 (map (λ (v) (* 2 v)) (filter (λ (v) (< (remainder v 10) 5)) (values (map sqr (filter odd? (range 0 v))))))))
(lambda (v) (for*/sum ([i (in-range v)] #:when (odd? i) [j (in-value (sqr i))] #:when (< (remainder j 10) 5)) (* j 2)))
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 |
3.4 range-map-car
(flow (~>> range (map sqr) car))
(lambda (v) (car (map sqr (range 0 v))))
(lambda (v) (for/first ([i (in-range v)]) (sqr i)))
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 |