diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-09 22:19:01 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-09 22:19:01 +0200 |
commit | f56daa40756cb4f356c283567de9cbc050bd86b1 (patch) | |
tree | 778a1bbada2a00acc854a85721f36618b6ce4f6b /module/vcomponent/datetime.scm | |
parent | Clean up util header. (diff) | |
parent | Add short commentary on difference between parse and parse/component. (diff) | |
download | calp-f56daa40756cb4f356c283567de9cbc050bd86b1.tar.gz calp-f56daa40756cb4f356c283567de9cbc050bd86b1.tar.xz |
Replace iCalendar parser.
The old iCalendar parser was a direct port of my C parser, which
unfortunately clashed with guile's evaluation model, and was therefore
really slow.
This new one is much schemier [sic?], and therefore much faster. On my
laptop the parse time went from around 10s to 2.5s, so a 4x speedup!
Diffstat (limited to '')
-rw-r--r-- | module/vcomponent/datetime.scm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/module/vcomponent/datetime.scm b/module/vcomponent/datetime.scm index 44776516..68909809 100644 --- a/module/vcomponent/datetime.scm +++ b/module/vcomponent/datetime.scm @@ -66,9 +66,9 @@ Event must have the DTSTART and DTEND attribute set." (date-max start-date (attr e 'DTSTART))) (datetime-difference (datetime-min (datetime date: (date+ end-date (date day: 1))) - (get-datetime (attr e 'DTEND))) + (attr e 'DTEND)) (datetime-max (datetime date: start-date) - (get-datetime (attr e 'DTSTART)))))) + (attr e 'DTSTART))))) ;; Returns the length of the part of @var{e} which is within the day ;; starting at the time @var{start-of-day}. @@ -76,8 +76,8 @@ Event must have the DTSTART and DTEND attribute set." ;; to a datetime to allow for more explicit TZ handling? (define-public (event-length/day date e) ;; TODO date= > 2 elements - (let ((start (get-datetime (attr e 'DTSTART))) - (end (get-datetime (attr e 'DTEND)))) + (let ((start (attr e 'DTSTART)) + (end (attr e 'DTEND))) (cond [(and (date= (as-date start) (as-date end)) (date= (as-date start) |