[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bdfdbe4 151/271: Improve benchmarks.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master bdfdbe4 151/271: Improve benchmarks. |
Date: |
Thu, 05 Feb 2015 18:30:42 +0000 |
branch: master
commit bdfdbe4d68cb86b855d6a4f6aefb7e825aee2439
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Improve benchmarks.
---
benchmark/context-coloring-benchmark.el | 76 ++++++++++++++++++++++---------
1 files changed, 55 insertions(+), 21 deletions(-)
diff --git a/benchmark/context-coloring-benchmark.el
b/benchmark/context-coloring-benchmark.el
index e7b5b8b..4403fe8 100644
--- a/benchmark/context-coloring-benchmark.el
+++ b/benchmark/context-coloring-benchmark.el
@@ -4,45 +4,79 @@
(defun context-coloring-benchmark-resolve-path (path)
(expand-file-name path context-coloring-benchmark-path))
-(defun context-coloring-benchmark-setup ()
- (setq context-coloring-benchmark-colorization t)
+(defun context-coloring-benchmark-log-results (result-file fixture)
+ (elp-results)
+ (let ((results-buffer (current-buffer)))
+ (with-temp-buffer
+ (insert (concat fixture "\n"))
+ (prepend-to-buffer results-buffer (point-min) (point-max)))
+ (with-temp-buffer
+ (insert "\n")
+ (append-to-buffer results-buffer (point-min) (point-max))))
+ (append-to-file nil nil result-file))
+
+(defun context-coloring-benchmark-js-mode-setup ()
(add-hook 'js-mode-hook 'context-coloring-mode)
(elp-instrument-package "context-coloring-"))
-(defun context-coloring-benchmark-teardown ()
- (setq context-coloring-benchmark-colorization nil)
+(defun context-coloring-benchmark-js-mode-teardown ()
(remove-hook 'js-mode-hook 'context-coloring-mode))
-(defun context-coloring-benchmark-run ()
- (context-coloring-benchmark-setup)
-
+(defun context-coloring-benchmark-js-mode-run ()
+ (context-coloring-benchmark-js-mode-setup)
(let ((result-file (context-coloring-benchmark-resolve-path
- (concat "./results-" (format-time-string "%s") ".log"))))
-
+ (concat "./results-js-mode-" (format-time-string "%s")
".log"))))
(dolist (path '("./fixtures/jquery-2.1.1.js"
"./fixtures/lodash-2.4.1.js"
"./fixtures/async-0.9.0.js"
"./fixtures/mkdirp-0.5.0.js"))
-
(let ((fixture (context-coloring-benchmark-resolve-path path)))
-
;; Test 5 times.
(find-file fixture)
(dotimes (n 4)
(sit-for 1)
(revert-buffer t t))
(sit-for 1)
+ (context-coloring-benchmark-log-results result-file fixture))))
+ (context-coloring-benchmark-js-mode-teardown))
- (elp-results)
- (let ((results-buffer (current-buffer)))
- (with-temp-buffer
- (insert (concat fixture "\n"))
- (prepend-to-buffer results-buffer (point-min) (point-max)))
- (with-temp-buffer
- (insert "\n")
- (append-to-buffer results-buffer (point-min) (point-max))))
+(defun context-coloring-benchmark-js2-mode-setup ()
+ (add-to-list 'load-path (context-coloring-benchmark-resolve-path
+ "../test/fixtures/js2-mode"))
+ (require 'js2-mode)
+ (setq js2-mode-show-parse-errors nil)
+ (setq js2-mode-show-strict-warnings nil)
+ (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
+ (add-hook 'js2-mode-hook 'context-coloring-mode)
+ (elp-instrument-package "context-coloring-"))
- (append-to-file nil nil result-file))))
+(defun context-coloring-benchmark-js2-mode-teardown ()
+ (remove-hook 'js2-mode-hook 'context-coloring-mode)
+ (setq auto-mode-alist (delete '("\\.js\\'" . js2-mode)
+ auto-mode-alist))
+ (setq js2-mode-show-strict-warnings t)
+ (setq js2-mode-show-parse-errors t)
+ (setq load-path (delete (context-coloring-benchmark-resolve-path
+ "../test/fixtures/js2-mode")
+ load-path)))
- (context-coloring-benchmark-teardown)
+(defun context-coloring-benchmark-js2-mode-run ()
+ (context-coloring-benchmark-js2-mode-setup)
+ (let ((result-file (context-coloring-benchmark-resolve-path
+ (concat "./results-js2-mode-" (format-time-string "%s")
".log"))))
+ (dolist (path '("./fixtures/jquery-2.1.1.js"
+ "./fixtures/lodash-2.4.1.js"
+ "./fixtures/async-0.9.0.js"
+ "./fixtures/mkdirp-0.5.0.js"))
+ (let ((fixture (context-coloring-benchmark-resolve-path path)))
+ ;; Test 5 times.
+ (find-file fixture)
+ (dotimes (n 4)
+ (revert-buffer t t))
+ (context-coloring-benchmark-log-results result-file fixture))))
+ (context-coloring-benchmark-js2-mode-teardown))
+
+(defun context-coloring-benchmark-run ()
+ ;; (context-coloring-benchmark-js-mode-run)
+ (context-coloring-benchmark-js2-mode-run)
(kill-emacs))
- [elpa] master c8fa33f 170/271: Improve async benchmarking., (continued)
- [elpa] master c8fa33f 170/271: Improve async benchmarking., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7954efc 110/271: Rename instances of depth to level., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 338716d 161/271: Refactor., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fc81cf9 157/271: Don't use timers for js2-mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b4c220a 159/271: Always remove hooks., Jackson Ray Hamilton, 2015/02/05
- [elpa] master e040ca0 181/271: Just use stable emacs., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9e7ee77 155/271: Add catch test. Don't uncolorize., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 665a54a 167/271: Add more js-mode tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 43f2e3b 168/271: Increase reliability of async tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 28183e4 188/271: Readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master bdfdbe4 151/271: Improve benchmarks.,
Jackson Ray Hamilton <=
- [elpa] master d27f2fe 182/271: Fix callback removal., Jackson Ray Hamilton, 2015/02/05
- [elpa] master cb0644a 136/271: Cleanup JavaScript tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c1e9226 171/271: Reorganize lib., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9e14226 135/271: Merge branch 'feature/language-generalization' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7473cc9 169/271: Improve documentation and error handling for async tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b468d1c 166/271: Improve block scope test. Rename and document block scope variable., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d411168 175/271: Revert to single var., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4c5f3ab 145/271: Fix first-run bug, passing js2-mode test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 15bfad7 165/271: Renames., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4d73262 152/271: Speed up local name lookup., Jackson Ray Hamilton, 2015/02/05