emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/benchmarks 162a8fa 3/3: Add a selector function as


From: Gemini Lasswell
Subject: [Emacs-diffs] scratch/benchmarks 162a8fa 3/3: Add a selector function as a way to avoid running all the tasks
Date: Tue, 27 Nov 2018 15:32:19 -0500 (EST)

branch: scratch/benchmarks
commit 162a8fa443b9bcbacc391f2f298a440f14710197
Author: Gemini Lasswell <address@hidden>
Commit: Gemini Lasswell <address@hidden>

    Add a selector function as a way to avoid running all the tasks
    
    * lisp/emacs-lisp/erb.el (erb-task-select-function): New variable.
    (erb--benchmark-one-commit): Use it.
---
 lisp/emacs-lisp/erb.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/erb.el b/lisp/emacs-lisp/erb.el
index 7d3f33d..48f81a9 100644
--- a/lisp/emacs-lisp/erb.el
+++ b/lisp/emacs-lisp/erb.el
@@ -1013,19 +1013,28 @@ system, remove it."
 
 ;;;; Run benchmarks
 
+;; Todo UI for this
+(defvar erb-task-select-function nil
+  "If non-nil, a function to select the benchmark tasks to run.
+Passed one argument, TASK, an `erb--metadata' structure.  Return
+non-nil if TASK should be run.")
+
 (defun erb--benchmark-one-commit (commit target-emacs)
   "Run the benchmark tasks for one COMMIT and record the results.
 The executable to run should be found in the subdirectory
 'result' of the directory TARGET-EMACS."
   (let* ((tasks (erb--vc-tasks-for-commmit commit))
+        (selected-tasks (seq-filter (or erb-task-select-function
+                                        #'identity)
+                                    tasks))
          (benchmark-task-files (directory-files-recursively
                                 (erb--benchmark-dir) "\\.el$"))
          (all-run-results (make-erb--run-results)))
     (when tasks
       (dolist (file benchmark-task-files)
-        (when-let* ((selected-tasks (erb--filter-by-file tasks file)))
+        (when-let* ((file-tasks (erb--filter-by-file selected-tasks file)))
           (let* ((this-run-results (erb--run-tasks target-emacs
-                                                   file selected-tasks)))
+                                                   file file-tasks)))
             (setq all-run-results
                   (erb--merge-run-results all-run-results
                                           this-run-results))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]