Skip to content

Commit

Permalink
ADD more benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
ndwarshuis committed Aug 9, 2024
1 parent ce1667b commit 2910436
Showing 1 changed file with 58 additions and 2 deletions.
60 changes: 58 additions & 2 deletions bench/org-ml-benchmarks.el
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@
(org-ml-update-headlines* 'all
(org-ml-headline-set-planning pl it)))))

(org-ml-defbench "schedule headline (supersection)" 1000
"* headline"
;; TODO a better test for this would be to put a logbook underneath the
;; planning ts since in that case we need to also parse the logbook
(org-ml-defbench "schedule headline (supercontents)" 1000
(list "* headline")
;; ":LOGGING:"
;; "- Note taken on [2024-08-07 Wed 20:07] \\"
;; "thingy"
;; ":END:")
(let ((org-adapt-indentation nil)
(next t))
(while next
Expand Down Expand Up @@ -143,6 +149,29 @@
(list :scheduled))
it))))

(org-ml-defbench "reschedule headline (supercontents)" 1000
(list "* headline"
"SCHEDULED: <2020-01-01 Wed>")
(let ((org-adapt-indentation nil)
(next t))
(while next
(->> (org-get-scheduled-time (point))
(float-time)
;; shift up one day
(+ (* 24 60 60))
(format-time-string "%Y-%m-%d")
(org-schedule nil))
(setq next (outline-next-heading))))

(org-ml-wrap-impure
(org-ml-update-supercontents* nil 'all
(org-ml-supercontents-set-planning
(list :scheduled
(org-ml-timelist-shift
1 'day
(plist-get (org-ml-supercontents-get-planning it) :scheduled)))
it))))

(org-ml-defbench "set headline effort" 1000
"* headline"
(let ((org-adapt-indentation nil)
Expand All @@ -155,6 +184,18 @@
(org-ml-update-headlines* 'all
(org-ml-headline-set-node-property "Effort" "0:05" it))))

(org-ml-defbench "set headline effort (supercontents)" 1000
"* headline"
(let ((org-adapt-indentation nil)
(next t))
(while next
(org-set-property "Effort" "0:05")
(setq next (outline-next-heading))))

(org-ml-wrap-impure
(org-ml-update-supercontents* nil 'all
(org-ml-supercontents-set-node-properties '(("Effort" "0:05")) it))))

(org-ml-defbench "set checkboxes" 1000
(list "* headline [0/0]"
"- [ ] one"
Expand Down Expand Up @@ -185,6 +226,21 @@
(org-ml-wrap-impure
(org-ml-headline-set-section (list para) it)))))

(org-ml-defbench "insert headline text (supercontents)" 2500
"* headline"
(let ((org-adapt-indentation nil)
(next t))
(while next
(save-excursion
(org-end-of-subtree)
(insert "\nsome text"))
(setq next (outline-next-heading))))

(let ((para (org-ml-build-paragraph! "some text")))
(org-ml-wrap-impure
(org-ml-update-supercontents* nil 'all
(org-ml-supercontents-set-contents (list para) it)))))

(org-ml-defbench "set headline effort/TODO/scheduled" 1000
"* headline"
(let ((org-log-done 'time)
Expand Down

0 comments on commit 2910436

Please sign in to comment.