diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-09 23:47:05 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-03-09 23:47:05 +0100 |
commit | 3b8565c33b58196ffe2e3dd8f23a73de57a268f2 (patch) | |
tree | 9d3526ea9bcc2ba9a7eb797103549baeb3c3ce6c /module/vcomponent | |
parent | Cleanup in HTML chunked main. (diff) | |
download | calp-3b8565c33b58196ffe2e3dd8f23a73de57a268f2.tar.gz calp-3b8565c33b58196ffe2e3dd8f23a73de57a268f2.tar.xz |
Sprinkled in some time prints.
Diffstat (limited to 'module/vcomponent')
-rw-r--r-- | module/vcomponent/load.scm | 5 | ||||
-rw-r--r-- | module/vcomponent/parse.scm | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/module/vcomponent/load.scm b/module/vcomponent/load.scm index 0cb03b42..e3e6f192 100644 --- a/module/vcomponent/load.scm +++ b/module/vcomponent/load.scm @@ -1,6 +1,7 @@ (define-module (vcomponent load) :export (load-calendars load-calendars*) :use-module (util) + :use-module (util time) :use-module (srfi srfi-1) :use-module (datetime) :use-module (datetime util) @@ -17,7 +18,9 @@ ;; Reads all calendar files from disk, generate recurence-sets for all repeating events, ;; and returns a list of calendars, and a stream of all events "ready" for display. (define* (load-calendars #:key (calendar-files (calendar-files))) + (report-time! "Parsing ~a calendars" (length calendar-files)) (let* ((calendars regular repeating (load-calendars* #:calendar-files calendar-files))) + (report-time! "Calendars loaded, interleaving and reccurring") (values calendars (interleave-streams @@ -39,8 +42,10 @@ (children cal))) calendars))) + (report-time! "Parse done, partitioning...") (let* ((repeating regular (partition repeating? events))) + (report-time! "Sorting") ;; NOTE There might be instances where we don't care if the ;; collection if sorted, but for the time beieng it's much ;; easier to always sort it. diff --git a/module/vcomponent/parse.scm b/module/vcomponent/parse.scm index 32b368c7..ef31cbd0 100644 --- a/module/vcomponent/parse.scm +++ b/module/vcomponent/parse.scm @@ -11,6 +11,7 @@ :use-module ((ice-9 ftw) :select (scandir ftw)) :use-module (util) + :use-module (util time) :use-module (util strbuf) :use-module (vcomponent base) :use-module (vcomponent datetime) @@ -92,6 +93,7 @@ ;; Reads a vcomponent from the given port. (define-public (parse-calendar port) + ;; (report-time! "Parsing ~a" port) (with-input-from-port port (lambda () (let ((component (make-vcomponent)) @@ -359,6 +361,7 @@ row ~a column ~a ctx = ~a (set! (attr comp 'X-HNH-SOURCETYPE) "file") comp) ] [(directory) + (report-time! "Parsing ~a" path) (let ((comp (parse-vdir path))) (set! (attr comp 'X-HNH-SOURCETYPE) "vdir") comp)] |