d12frosted / vulpea

A collection of functions for note taking based on `org` and `org-roam`.
GNU General Public License v3.0
237 stars 12 forks source link

(feat) functions to query by tags #113

Closed d12frosted closed 2 years ago

d12frosted commented 2 years ago

Not sure why CI is red on Emacs 27.2, I will investigate that later. Meanwhile, this is what this PR achieves (numbers for 10 runs):

    select with filter is relatively fast on 9500+ notes (29.63s)
[01:36.974]  duration specialized = (0.004020379 0 0.0)
[01:36.974]  duration generic     = (26.946339665 40 3.8706401909999997)
d12frosted commented 2 years ago

Also, will add more info about performance considerations later on

d12frosted commented 2 years ago

:thinking: :to-have-same-items-as matcher should treat lists as sets, but it seems like it doesn't like the order

(
#s(vulpea-note "5093fc4e-8c63-4e60-a1da-83fc7ecd5db7" "/tmp/note-files0sBf89/reference.org" 0 "Reference" nil nil ("tag1" "tag2" "tag3") nil (("CATEGORY" . "reference") ("ID" . "5093fc4e-8c63-4e60-a1da-83fc7ecd5db7") ("BLOCKED" . "") ("FILE" . "/tmp/note-files0sBf89/reference.org") ("PRIORITY" . "B")) nil)
#s(vulpea-note "68f11246-91e1-4d48-b3c6-801a2ef0160b" "/tmp/note-files0sBf89/same-name-2.org" 0 "Duplicating Term" nil nil ("tag3") nil (("CATEGORY" . "same-name-2") ("ID" . "68f11246-91e1-4d48-b3c6-801a2ef0160b") ("BLOCKED" . "") ("FILE" . "/tmp/note-files0sBf89/same-name-2.org") ("PRIORITY" . "B")) nil))

', but instead it was `

(
#s(vulpea-note "68f11246-91e1-4d48-b3c6-801a2ef0160b" "/tmp/note-files0sBf89/same-name-2.org" 0 "Duplicating Term" nil nil ("tag3") nil (("CATEGORY" . "same-name-2") ("ID" . "68f11246-91e1-4d48-b3c6-801a2ef0160b") ("BLOCKED" . "") ("FILE" . "/tmp/note-files0sBf89/same-name-2.org") ("PRIORITY" . "B")) nil)
#s(vulpea-note "5093fc4e-8c63-4e60-a1da-83fc7ecd5db7" "/tmp/note-files0sBf89/reference.org" 0 "Reference" nil nil ("tag1" "tag2" "tag3") nil (("CATEGORY" . "reference") ("ID" . "5093fc4e-8c63-4e60-a1da-83fc7ecd5db7") ("BLOCKED" . "") ("FILE" . "/tmp/note-files0sBf89/reference.org") ("PRIORITY" . "B")) nil))

' which does not match because: (list-elt 0 (struct-field id (array-elt 0 (different-atoms (54 "#x36" "?6") (53 "#x35" "?5")))))
d12frosted commented 2 years ago

🤦 there was a typo and I looked into other test case 🤦