(defun test-node-creation-original (rows)
(cl-loop for row in rows
append (pcase-let* ((`(,id ,file ,file-title ,level ,todo
,pos ,priority ,scheduled ,deadline
,title ,properties ,olp ;;12
,atime ,mtime ,tags ,aliases ,refs)
row)
(all-titles (cons title aliases)))
(mapcar (lambda (temp-title)
(org-roam-node-create :id id
:file file
:file-title file-title
:file-atime atime
:file-mtime mtime
:level level
:point pos
:todo todo
:priority priority
:scheduled scheduled
:deadline deadline
:title temp-title
:aliases aliases
:properties properties
:olp olp
:tags tags
:refs refs))
all-titles)))))
test-node-creation-original
(defun test-node-creation-new (rows)
(mapcan
(lambda (row)
(let (
(all-titles (cons (car row) (nth 1 row)))
)
(mapcar (lambda (temp-title)
(apply 'org-roam-node-create-from-db (cons temp-title (cdr row))))
all-titles)
))
rows)
)
test-node-creation-new
(setq test-list (make-list 100000
'("a" ("bb") "c" "d" "e" ;; 5
"f" "g" "h" "i" "j" ; 10
"k" "l" "m" "n" "o" ;; 15
("xa") ("aa")))) ;; 18
1
1
(defun dmg-test-function ()
(test-node-creation-original test-list))
(cl-loop
for i from 1 to 10
collect (benchmark-run 1 (dmg-test-function)))
10.537263000000001 | 3 | 0.7531709999999947 |
11.296617 | 4 | 1.158483000000004 |
11.043042000000002 | 4 | 1.0624009999999942 |
10.78367 | 4 | 1.0448480000000018 |
10.584986 | 3 | 0.7671279999999996 |
11.321531 | 4 | 1.2324100000000016 |
11.165188 | 4 | 1.0686970000000002 |
11.364648 | 4 | 1.1126469999999955 |
10.927094 | 3 | 0.8215220000000016 |
11.181801 | 4 | 1.1664640000000048 |
(defun dmg-test-function2 ()
(test-node-creation-new test-list))
(cl-loop
for i from 1 to 10
collect (benchmark-run 1 (dmg-test-function2)))
1.418631 | 1 | 0.27120800000000145 |
1.1506 | 0 | 0.0 |
1.373139 | 1 | 0.23833300000001145 |
1.368514 | 1 | 0.2306819999999874 |
1.375305 | 1 | 0.22759200000000135 |
1.353388 | 1 | 0.23199800000000437 |
1.369873 | 1 | 0.23419200000000728 |
1.374019 | 1 | 0.23432599999999582 |
1.370381 | 1 | 0.2383299999999906 |
1.390439 | 1 | 0.23972100000000296 |