aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-20 04:24:06 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-20 04:24:06 +0200
commit18824ea7ebff5f72072c2de0dee9af0b6f086e1c (patch)
treec536de420e7d65378b7cea21d5c660efd5e7cce0
parents/TOOD/TODO/ (diff)
downloadcalp-18824ea7ebff5f72072c2de0dee9af0b6f086e1c.tar.gz
calp-18824ea7ebff5f72072c2de0dee9af0b6f086e1c.tar.xz
Remove badly written performance test.
-rw-r--r--tests/stream-time.scm.disabled63
1 files changed, 0 insertions, 63 deletions
diff --git a/tests/stream-time.scm.disabled b/tests/stream-time.scm.disabled
deleted file mode 100644
index d604d0f4..00000000
--- a/tests/stream-time.scm.disabled
+++ /dev/null
@@ -1,63 +0,0 @@
-;;; Commentary:
-
-;; This is not really a test of calparse, but just some benchmarks on Guile's
-;; built in SRFI-41 (stream) implementation. While running interactively the code
-;; @lisp
-;; (stream 1 2 3)
-;; @end lisp
-;; is extremely slow (0.5s). The problem however seems to go away during
-;; compilation. Note however that
-;; @lisp
-;; (list->stream '(1 2 3))
-;; @end lisp
-;; is fast in both cases.
-
-;;; Code:
-
-(use-modules (srfi srfi-19) ; Time
- (srfi srfi-41) ; Streams
- (srfi srfi-64) ; Tests
- (srfi srfi-71) ; let-multiple
- (ice-9 format))
-
-;;; TODO use statprof insteadd
-
-(define (timed thunk)
- "Returns two values, @var{result} and @var{time ellapsed}."
- (let ((start-time (current-time time-process)))
- (let ((result (thunk)))
- (let ((end-time (current-time time-process)))
- (values result
- (time-difference end-time start-time))))))
-
-(define-syntax-rule (with-printed-time port expr ...)
- (let ((result duration (timed (lambda () expr ...))))
- (format port "~6f :: ~a~%"
- (+ (time-second duration)
- (/ (time-nanosecond duration) 1e5))
- (quote expr ...))))
-
-(with-printed-time #t (stream 1 2 3 4 5))
-(with-printed-time #t (list->stream '(1 2 3 4 5)))
-(with-printed-time #t (stream->list (list->stream '(1 2 3 4 5))))
-(with-printed-time
- #t (stream-cons
- 1 (stream-cons
- 2 (stream-cons
- 3 (stream-cons
- 4 (stream-cons
- 5 stream-null))))))
-
-(display (make-string 60 #\-)) (newline)
-
-(eval-when (load)
- (with-printed-time #t (stream 1 2 3 4 5))
- (with-printed-time #t (list->stream '(1 2 3 4 5)))
- (with-printed-time #t (stream->list (list->stream '(1 2 3 4 5))))
- (with-printed-time
- #t (stream-cons
- 1 (stream-cons
- 2 (stream-cons
- 3 (stream-cons
- 4 (stream-cons
- 5 stream-null)))))))