diff options
author | Andy Wingo <wingo@pobox.com> | 2017-11-29 21:04:59 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-11-29 21:04:59 +0100 |
commit | f85d3c0bd886e46e6ab3fc858231c8b2aa3e954d (patch) | |
tree | 9afe1139ddece9c4686e177b49e847ac0730f8d7 /benchmark-suite | |
parent | 39520f879a41821ad63ed85fd227b9ec421cb8b7 (diff) | |
parent | e0bcda4ad940c4e15679cc2b229838b33acdd36c (diff) | |
download | guile-f85d3c0bd886e46e6ab3fc858231c8b2aa3e954d.tar.gz |
Merge until e0bcda4ad940c4e15679cc2b229838b33acdd36c from stable-2.2
Diffstat (limited to 'benchmark-suite')
-rw-r--r-- | benchmark-suite/Makefile.am | 2 | ||||
-rw-r--r-- | benchmark-suite/benchmarks/bytevector-io.bm (renamed from benchmark-suite/benchmarks/uniform-vector-read.bm) | 29 |
2 files changed, 15 insertions, 16 deletions
diff --git a/benchmark-suite/Makefile.am b/benchmark-suite/Makefile.am index 12221211e..47bd0365d 100644 --- a/benchmark-suite/Makefile.am +++ b/benchmark-suite/Makefile.am @@ -1,5 +1,6 @@ SCM_BENCHMARKS = benchmarks/0-reference.bm \ benchmarks/arithmetic.bm \ + benchmarks/bytevector-io.bm \ benchmarks/bytevectors.bm \ benchmarks/chars.bm \ benchmarks/continuations.bm \ @@ -13,7 +14,6 @@ SCM_BENCHMARKS = benchmarks/0-reference.bm \ benchmarks/srfi-13.bm \ benchmarks/structs.bm \ benchmarks/subr.bm \ - benchmarks/uniform-vector-read.bm \ benchmarks/vectors.bm \ benchmarks/vlists.bm \ benchmarks/write.bm \ diff --git a/benchmark-suite/benchmarks/uniform-vector-read.bm b/benchmark-suite/benchmarks/bytevector-io.bm index 01b747836..7ae7c0e02 100644 --- a/benchmark-suite/benchmarks/uniform-vector-read.bm +++ b/benchmark-suite/benchmarks/bytevector-io.bm @@ -1,6 +1,6 @@ -;;; uniform-vector-read.bm --- Exercise binary I/O primitives. -*- Scheme -*- +;;; bytevector-io.bm --- Exercise bytevector I/O primitives. -*- Scheme -*- ;;; -;;; Copyright (C) 2008 Free Software Foundation, Inc. +;;; Copyright (C) 2008, 2017 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 @@ -17,9 +17,10 @@ ;;; not, write to the Free Software Foundation, Inc., 51 Franklin ;;; Street, Fifth Floor, Boston, MA 02110-1301 USA -(define-module (benchmarks uniform-vector-read) +(define-module (benchmarks bytevector-io) :use-module (benchmark-suite lib) - :use-module (srfi srfi-4)) + :use-module (rnrs io ports) + :use-module (rnrs bytevectors)) (define file-name (tmpnam)) @@ -30,24 +31,22 @@ (define buf (make-u8vector %buffer-size)) -(define str - (make-string %buffer-size)) - -(with-benchmark-prefix "uniform-vector-read!" +(with-benchmark-prefix "bytevector i/o" - (benchmark "uniform-vector-write" 4000 + (benchmark "put-bytevector" 4000 (let ((output (open-output-file file-name))) - (uniform-vector-write buf output) + (put-bytevector output buf) (close output))) - (benchmark "uniform-vector-read!" 20000 + (benchmark "get-bytevector-n!" 20000 (let ((input (open-input-file file-name))) (setvbuf input 'none) - (uniform-vector-read! buf input) + (get-bytevector-n! input buf 0 (bytevector-length buf)) (close input))) - (benchmark "string port" 5000 - (let ((input (open-input-string str))) - (uniform-vector-read! buf input) + (benchmark "get-bytevector-n" 20000 + (let ((input (open-input-file file-name))) + (setvbuf input 'none) + (get-bytevector-n input (bytevector-length buf)) (close input)))) |