Add: (habit) preamble
This commit is contained in:
parent
1c5bf06804
commit
2cdc210645
2 changed files with 18 additions and 0 deletions
14
notes.org
14
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 |
|
| preamble: (deadline <= "2019-01-01") | 27.91 | 0.014606 | 0 | 0 |
|
||||||
| no preamble: (deadline <= "2019-01-01") | slowest | 0.407682 | 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=
|
*** =level=
|
||||||
|
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
|
|
|
||||||
|
|
@ -348,6 +348,10 @@ replace the clause with a preamble."
|
||||||
t))
|
t))
|
||||||
;; Return nil, don't test the predicate.
|
;; Return nil, don't test the predicate.
|
||||||
nil)
|
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)
|
(`(level ,comparator-or-num ,num)
|
||||||
(let ((repeat (pcase comparator-or-num
|
(let ((repeat (pcase comparator-or-num
|
||||||
('< `(repeat 1 ,(1- num) "*"))
|
('< `(repeat 1 ,(1- num) "*"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue