summaryrefslogtreecommitdiff
path: root/gc-benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'gc-benchmarks')
-rw-r--r--gc-benchmarks/Makefile.am55
-rwxr-xr-xgc-benchmarks/gc-profile.scm11
2 files changed, 63 insertions, 3 deletions
diff --git a/gc-benchmarks/Makefile.am b/gc-benchmarks/Makefile.am
new file mode 100644
index 000000000..0fdbcdcea
--- /dev/null
+++ b/gc-benchmarks/Makefile.am
@@ -0,0 +1,55 @@
+## Process this file with automake to produce Makefile.in.
+##
+## Copyright (C) 2011 Free Software Foundation, Inc.
+##
+## This file is part of GUILE.
+##
+## GUILE is free software; you can redistribute it and/or modify it
+## under the terms of the GNU Lesser General Public License as
+## published by the Free Software Foundation; either version 3, or
+## (at your option) any later version.
+##
+## GUILE is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with GUILE; see the file COPYING.LESSER. If not,
+## write to the Free Software Foundation, Inc., 51 Franklin Street,
+## Fifth Floor, Boston, MA 02110-1301 USA
+
+EXTRA_DIST = \
+ gc-profile.scm \
+ gcbench.scm \
+ guile-test.scm \
+ loop.scm \
+ run-benchmark.scm \
+ string.scm \
+ $(benchmarks)
+
+# GPLv2+ Larceny GC benchmarks by Lars Hansen et al. from
+# <http://www.ccs.neu.edu/home/will/GC/sourcecode.html>.
+benchmarks = \
+ larceny/GPL \
+ larceny/README \
+ larceny/dumb.sch \
+ larceny/dummy.sch \
+ larceny/dynamic-input-large.sch \
+ larceny/dynamic-input-small.sch \
+ larceny/dynamic.sch \
+ larceny/earley.sch \
+ larceny/gcbench.sch \
+ larceny/gcold.scm \
+ larceny/graphs.sch \
+ larceny/lattice.sch \
+ larceny/nboyer.sch \
+ larceny/nucleic2.sch \
+ larceny/perm.sch \
+ larceny/run-benchmark.chez \
+ larceny/sboyer.sch \
+ larceny/softscheme.sch \
+ larceny/twobit-input-long.sch \
+ larceny/twobit-input-short.sch \
+ larceny/twobit-smaller.sch \
+ larceny/twobit.sch
diff --git a/gc-benchmarks/gc-profile.scm b/gc-benchmarks/gc-profile.scm
index 3365832a0..d95e29572 100755
--- a/gc-benchmarks/gc-profile.scm
+++ b/gc-benchmarks/gc-profile.scm
@@ -3,7 +3,7 @@
exec ${GUILE-guile} --no-debug -q -l "$0" \
-c '(apply main (cdr (command-line)))' "$@"
!#
-;;; Copyright (C) 2008 Free Software Foundation, Inc.
+;;; Copyright (C) 2008, 2011 Free Software Foundation, Inc.
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Lesser General Public License
@@ -38,13 +38,18 @@ memory mapping of process @var{pid}. This information is obtained by reading
@file{/proc/PID/smaps} on Linux. See `procs(5)' for details."
(define mapping-line-rx
+ ;; As of Linux 2.6.32.28, an `smaps' line looks like this:
+ ;; "00400000-00401000 r-xp 00000000 fe:00 108264 /home/ludo/soft/bin/guile"
(make-regexp
- "^([[:xdigit:]]+)-([[:xdigit:]]+) ([rwx-]{3}[ps]) ([[:xdigit:]]+) [0-9]{2}:[0-9]{2} [0-9]+[[:blank:]]+(.*)$"))
+ "^([[:xdigit:]]+)-([[:xdigit:]]+) ([rwx-]{3}[ps]) ([[:xdigit:]]+) [[:xdigit:]]{2}:[[:xdigit:]]{2} [0-9]+[[:blank:]]+(.*)$"))
(define rss-line-rx
(make-regexp
"^Rss:[[:blank:]]+([[:digit:]]+) kB$"))
+ (if (not (string-contains %host-type "-linux-"))
+ (error "this procedure only works on Linux-based systems" %host-type))
+
(with-input-from-port (open-input-file (format #f "/proc/~a/smaps" pid))
(lambda ()
(let loop ((line (read-line))
@@ -83,7 +88,7 @@ memory mapping of process @var{pid}. This information is obtained by reading
(loop (read-line) result))))))))
(define (total-heap-size pid)
- "Return the total heap size of process @var{pid}."
+ "Return a pair representing the total and RSS heap size of PID."
(define heap-or-anon-rx
(make-regexp "\\[(heap|anon)\\]"))