guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ‘map’ and ‘for-each’ written in Scheme


From: Andy Wingo
Subject: Re: ‘map’ and ‘for-each’ written in Scheme
Date: Sun, 08 May 2011 17:31:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

On Sun 08 May 2011 17:05, address@hidden (Ludovic Courtès) writes:

> Could you add benchmarks so we can see how the Scheme and C
> implementations compare?

Done.

Current Guile:
  $ ./benchmark-guile srfi-1.bm
  Benchmarking /home/wingo/src/guile/meta/guile ... srfi-1.bm
  with GUILE_LOAD_PATH=/home/wingo/src/guile/benchmark-suite
  ;; running guile version 2.0.1.22-4cbd6
  ;; calibrating the benchmarking framework...
  ;; framework time per iteration: 5.72204532623291e-8
  ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
  ;;;       or pass the --no-auto-compile argument to disable.
  ;;; compiling /home/wingo/src/guile/benchmark-suite/benchmarks/srfi-1.bm
  ;;; compiled 
/home/wingo/src/guile/cache/guile/ccache/2.0-LE-8-2.0/home/wingo/src/guile/benchmark-suite/benchmarks/srfi-1.bm.go
  ("srfi-1.bm: fold: big" 30 user 2.03 benchmark 2.0299982833864 bench/interp 
2.0299982833864 gc 0.0)
  ("srfi-1.bm: fold: small" 2000000 user 1.54 benchmark 1.42555909347534 
bench/interp 1.42555909347534 gc 0.0)
  ("srfi-1.bm: drop-while: big" 30 user 1.78 benchmark 1.7799982833864 
bench/interp 1.7799982833864 gc 0.0)
  ("srfi-1.bm: drop-while: small" 2000000 user 1.38 benchmark 1.26555909347534 
bench/interp 1.26555909347534 gc 0.0)
  ("srfi-1.bm: map: big" 30 user 4.55 benchmark 4.5499982833864 bench/interp 
4.0847600543864 gc 0.465238229)
  ("srfi-1.bm: map: small" 2000000 user 3.2 benchmark 3.08555909347534 
bench/interp 2.97014448647534 gc 0.115414607)
  ("srfi-1.bm: for-each: big" 30 user 2.96 benchmark 2.9599982833864 
bench/interp 2.9599982833864 gc 0.0)
  ("srfi-1.bm: for-each: small" 2000000 user 2.34 benchmark 2.22555909347534 
bench/interp 2.22555909347534 gc 0.0)


Guile 1.8:
  $ /opt/guile-1.8/env ./benchmark-guile -i /opt/guile-1.8/bin/guile srfi-1.bm
  Benchmarking /opt/guile-1.8/bin/guile ... srfi-1.bm
  with GUILE_LOAD_PATH=/home/wingo/src/guile/benchmark-suite
  ERROR: no code for module (benchmark-suite lib)
  address@hidden:~/src/guile$ GUILE_LOAD_PATH=. /opt/guile-1.8/env 
./benchmark-guile -i /opt/guile-1.8/bin/guile srfi-1.bm
  Benchmarking /opt/guile-1.8/bin/guile ... srfi-1.bm
  with GUILE_LOAD_PATH=/home/wingo/src/guile/benchmark-suite:.
  ;; running guile version 1.8.7
  ;; calibrating the benchmarking framework...
  ;; framework time per iteration: 9.5367431640625e-8
  ("srfi-1.bm: fold: big" 30 user 7.14 benchmark 7.13999713897705 bench/interp 
3.72999713897705 gc 3.41)
  ("srfi-1.bm: fold: small" 2000000 user 6.07 benchmark 5.87926513671875 
bench/interp 2.91926513671875 gc 2.96)
  ("srfi-1.bm: drop-while: big" 30 user 5.51 benchmark 5.50999713897705 
bench/interp 2.92999713897705 gc 2.58)
  ("srfi-1.bm: drop-while: small" 2000000 user 3.18 benchmark 2.98926513671875 
bench/interp 1.90926513671875 gc 1.08)
  ("srfi-1.bm: map: big" 30 user 7.93 benchmark 7.92999713897705 bench/interp 
4.90999713897705 gc 3.02)
  ("srfi-1.bm: map: small" 2000000 user 4.04 benchmark 3.84926513671875 
bench/interp 2.42926513671875 gc 1.42)
  ("srfi-1.bm: for-each: big" 30 user 5.35 benchmark 5.34999713897705 
bench/interp 4.02999713897705 gc 1.32)
  ("srfi-1.bm: for-each: small" 2000000 user 3.22 benchmark 3.02926513671875 
bench/interp 1.91926513671875 gc 1.11)

Map and for-each are slower than fold right now because they check for
circular lists.  Dunno how useful that is, but it's what they always
have done.

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]