From 868a74cf754f992a2cf27c97344ddf3278e5e821 Mon Sep 17 00:00:00 2001 From: Peter Mao Date: Fri, 1 Sep 2023 19:06:07 -0700 Subject: [PATCH] update Notes.org for speed-test clean up whitespace change :results to "raw" so results from run-to run are maintained save with `:NOTER_PAGE: 1` so that the file opens ready-to-run --- tests/Notes.org | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/tests/Notes.org b/tests/Notes.org index 1726838..32b8cf5 100644 --- a/tests/Notes.org +++ b/tests/Notes.org @@ -221,7 +221,7 @@ direction. An easy calculation shows that the absolute value of the spin must be org-babel is slow on subsequent runs after B9, but direct execution with C-x C-e does not suffer the same performance degradation. - + **** summary of results (PM) 56a45e0: 4.45s (17x10) slower 2nd time in org babel, but consistent w/ C-xC-e (PM) 7d94dc2: 3.279694, 9.246695 (2 note-steps x 1 repeats) @@ -233,7 +233,7 @@ direction. An easy calculation shows that the absolute value of the spin must be **** raw results (PM) 56a45e0: 4.45s (17x10) slower 2nd time in org babel, but consistent w/ C-xC-e (PM) cd3c86c: 22.911387 (7 x 1) 2nd - (PM) cd3c86c: 4.101886, (7 x 24) 1st + (PM) cd3c86c: 4.101886, (7 x 24) 1st (PM) 7d94dc2: 3.279694, 9.246695 (2 note-steps x 1 repeats) (D1) a494169: 9.266794 (2 note-steps x 1 repeats) (M2) b30cbaa: 11.612586, 32.265847 (7 note-steps x 1 repeat) @@ -403,17 +403,17 @@ i * MobyDick :PROPERTIES: :NOTER_DOCUMENT: MobyDick.pdf - :NOTER_PAGE: 171 + :NOTER_PAGE: 1 :END: ** Skeleton To time this code, you need the measure-time macro. - #+begin_src elisp + #+begin_src elisp :results none ;; http://lists.gnu.org/archive/html/help-gnu-emacs/2008-06/msg00087.html (defmacro measure-time (&rest body) "Measure the time it takes to evaluate BODY." `(let ((time (current-time))) ,@body - (message "%.06f" (float-time (time-since time))))) + (message "%.2f s; %s; %s" (float-time (time-since time)) (org-version nil t) (version)))) (defmacro measure-time-sexp (&rest body) "Measure the time it takes to evaluate BODY. @@ -424,25 +424,31 @@ i (message "%.06f" (float-time (time-since time))) retval)) #+end_src + *** Title page :PROPERTIES: :NOTER_PAGE: 1 :END: - #+begin_src elisp - (let (ii jj - (note-steps 138) - (repeats 1)) - (measure-time - (other-window 1) - (dotimes (jj repeats) - (dotimes (ii note-steps) (org-noter-sync-next-page-or-chapter)) - (dotimes (ii note-steps) (org-noter-sync-prev-page-or-chapter))) - (other-window -1))) - #+end_src + #+begin_src elisp :results raw + (let (ii jj + (note-steps 138) + (repeats 1)) + (measure-time + (other-window -1) + (dotimes (jj repeats) + (dotimes (ii note-steps) (org-noter-sync-next-page-or-chapter)) + (dotimes (ii note-steps) (org-noter-sync-prev-page-or-chapter))) + (other-window -1))) + #+end_src #+RESULTS: - : 10.116560 + 11.12 s; Org mode version 9.4.6 (release_9.4.6 @ /home/peterm/emacs/org-mode/lisp/); GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) + of 2022-09-12 + 11.17 s; Org mode version 9.4.6 (release_9.4.6 @ /home/peterm/emacs/org-mode/lisp/); GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) + of 2022-09-12 + 14.61 s; Org mode version 9.4.6 (release_9.4.6 @ /home/peterm/emacs/org-mode/lisp/); GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) + of 2022-09-12 *** ETYMOLOGY :PROPERTIES: