diff --git a/notes.org b/notes.org index fff5876..e224aca 100644 --- a/notes.org +++ b/notes.org @@ -482,6 +482,20 @@ Not sure if clearing the cache is necessary here, because it seemed to make near | preamble: (deadline <= "2019-01-01") | 27.91 | 0.014606 | 0 | 0 | | no preamble: (deadline <= "2019-01-01") | slowest | 0.407682 | 0 | 0 | +*** =habit= + +#+BEGIN_SRC elisp + (org-ql-preamble-bench :times 1 + :file "~/org/inbox.org" + :query (habit)) +#+END_SRC + +#+RESULTS: +| Form | x faster than next | Total runtime | # of GCs | Total GC runtime | +|----------------------+--------------------+---------------+----------+------------------| +| preamble: (habit) | 70.09 | 0.016489 | 0 | 0 | +| no preamble: (habit) | slowest | 1.155649 | 0 | 0 | + *** =level= #+BEGIN_SRC elisp diff --git a/org-ql.el b/org-ql.el index b66f0a3..24d6d2c 100644 --- a/org-ql.el +++ b/org-ql.el @@ -348,6 +348,10 @@ replace the clause with a preamble." t)) ;; Return nil, don't test the predicate. nil) + (`(habit) + (setq org-ql-preamble (rx-to-string `(seq bol (0+ space) ":STYLE:" (1+ space) + "habit" (0+ space) eol))) + nil) (`(level ,comparator-or-num ,num) (let ((repeat (pcase comparator-or-num ('< `(repeat 1 ,(1- num) "*"))