From 3b8565c33b58196ffe2e3dd8f23a73de57a268f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 9 Mar 2020 23:47:05 +0100 Subject: Sprinkled in some time prints. --- module/vcomponent/load.scm | 5 +++++ module/vcomponent/parse.scm | 3 +++ 2 files changed, 8 insertions(+) (limited to 'module/vcomponent') 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)] -- cgit v1.2.3