You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add a constructor that does not take named parameters
(cl-defstruct (org-roam-node (:constructor org-roam-node-create)
(:constructor org-roam-node-create-from-db
(title
id file file-title level todo
pos priority scheduled deadline
properties olp atime mtime tags
aliases refs))
(:copiernil))
"A heading or top level file with an assigned ID property."
file file-title file-hash file-atime file-mtime
id level point todo priority scheduled deadline title properties olp
tags aliases refs)
test the original constructor 50,000 times
(defundmg-test-create-node (row)
;; (org-roam-node-create &key FILE FILE-TITLE FILE-HASH FILE-ATIME FILE-MTIME;; ID LEVEL POINT TODO PRIORITY;; SCHEDULED DEADLINE TITLE PROPERTIES OLP;; TAGS ALIASES REFS;; DEADLINE TITLE PROPERTIES OLP TAGS ALIASES REFS)
(pcase-let* ((`(,id,file,file-title,level,todo,pos,priority,scheduled,deadline,title,properties,olp,atime,mtime,tags,aliases,refs)
row)
)
(org-roam-node-create
:file file
:file-title file-title
;; file-hash:file-atime atime
:file-mtime mtime
:id id
:level level
:point pos
:todo todo
:priority priority
:scheduled scheduled
:deadline deadline
:title title
:properties properties
:olp olp
:tags tags
:aliases aliases
:refs refs))
)
(defundmg-test-function ()
(dmg-test-create-node '("a""b""c""d""e""f""g""h""i""j""k""l""m""n""o"
(123235989) "q"; "r"; "s" "t"
)))
(defundmg-test-function2()
(dotimes (i 50000)
(dmg-test-function)))
(cl-loopfor i from1to10collect (benchmark-run1 (dmg-test-function2)))