aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-22 23:56:53 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-22 23:56:53 +0200
commit921ae00b825640d00b576c1098bd92bb2e166de5 (patch)
tree8fc3fe7deb6ebb73ce155b19018d75a8dce7751b
parentMove more places to use path-append. (diff)
downloadcalp-921ae00b825640d00b576c1098bd92bb2e166de5.tar.gz
calp-921ae00b825640d00b576c1098bd92bb2e166de5.tar.xz
Some benchmarking impmrovements.
-rw-r--r--module/calp/benchmark/parse.scm4
-rw-r--r--module/calp/entry-points/benchmark.scm11
-rw-r--r--module/calp/main.scm4
3 files changed, 12 insertions, 7 deletions
diff --git a/module/calp/benchmark/parse.scm b/module/calp/benchmark/parse.scm
index 68a6d5ff..e9bc509f 100644
--- a/module/calp/benchmark/parse.scm
+++ b/module/calp/benchmark/parse.scm
@@ -12,6 +12,7 @@
(define all-calendar-files
(statprof
(lambda ()
+ (display "All calendar files\n")
(concatenate
(map (lambda (path)
(map
@@ -23,6 +24,7 @@
(define all-read
(statprof
(lambda ()
+ (display "All read\n")
(map (lambda ( fullname)
(let ((cal (call-with-input-file fullname
(@@ (vcomponent ical parse) read-file))))
@@ -32,6 +34,7 @@
(define tokenized
(statprof
(lambda ()
+ (display "Tokenized\n")
(map (lambda (one-read)
(map (@@ (vcomponent ical parse) tokenize)
one-read))
@@ -40,6 +43,7 @@
(define parsed
(statprof
(lambda ()
+ (display "Parsed\n")
(map (@@ (vcomponent ical parse) parse) tokenized))))
(format #t "~a files processed~%"
diff --git a/module/calp/entry-points/benchmark.scm b/module/calp/entry-points/benchmark.scm
index 8eaf3731..7706f6f0 100644
--- a/module/calp/entry-points/benchmark.scm
+++ b/module/calp/entry-points/benchmark.scm
@@ -28,8 +28,9 @@
(throw 'return))
- (awhen (option-ref opts '() #f)
- ((module-ref (resolve-module
- `(calp benchmark ,@(map string->symbol it)))
- 'run-benchmark)))
-)
+ (let ((opt (option-ref opts '() #f)))
+ (if (null? opt)
+ (print-arg-help opt-spec)
+ ((module-ref (resolve-module
+ `(calp benchmark ,@(map string->symbol opt)))
+ 'run-benchmark)))))
diff --git a/module/calp/main.scm b/module/calp/main.scm
index 709658d8..040a7c00 100644
--- a/module/calp/main.scm
+++ b/module/calp/main.scm
@@ -83,8 +83,8 @@
"reserializes it back into ICAL format. "
"Useful for merging calendars.")
- (p (b "benchmark") " Forces a field from the current app. Preferably used together with "
- (i "--statprof") " for some for profiling the code.")
+ (p (b "benchmark") " " (i "module") (br)
+ "Runs the procedure 'run-benchmark' from the module (calp benchmark " (i "module") ").")
(p (b "server") " starts an HTTP server which dynamicly loads and displays event. The "
(i "/month/{date}.html") " & " (i "/week/{date}.html") " runs the same output code as "