[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c6cdb04 03/10: Benchmark coloring time separately.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master c6cdb04 03/10: Benchmark coloring time separately. |
Date: |
Thu, 18 Jun 2015 08:33:55 +0000 |
branch: master
commit c6cdb04ffbe70015dd1c32cfee97c0ffe989a272
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Benchmark coloring time separately.
`elp-instrument-package' significantly affects the performance of
coloring.
---
benchmark/context-coloring-benchmark.el | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/benchmark/context-coloring-benchmark.el
b/benchmark/context-coloring-benchmark.el
index c2dd653..1f5885c 100644
--- a/benchmark/context-coloring-benchmark.el
+++ b/benchmark/context-coloring-benchmark.el
@@ -26,6 +26,7 @@
;;; Code:
(require 'context-coloring)
+(require 'elp)
(require 'js2-mode)
@@ -115,7 +116,6 @@ with STATISTICS."
callbacks. Measure the performance of all FIXTURES, calling
CALLBACK when all are done."
(funcall setup)
- (elp-instrument-package "context-coloring-")
(let ((result-file (context-coloring-benchmark-resolve-path
(format "./logs/results-%s-%s.log"
title (format-time-string "%s")))))
@@ -134,10 +134,12 @@ CALLBACK when all are done."
original-function
(lambda ()
(setq count (+ count 1))
- (push (- (float-time) colorization-start-time)
colorization-times)
- ;; Test 5 times.
+ ;; First 5 runs are for gathering real coloring times,
+ ;; unaffected by elp instrumentation.
+ (when (<= count 5)
+ (push (- (float-time) colorization-start-time)
colorization-times))
(cond
- ((= count 5)
+ ((= count 10)
(advice-remove #'context-coloring-colorize advice)
(context-coloring-benchmark-log-results
result-file
@@ -148,8 +150,14 @@ CALLBACK when all are done."
:words (count-words (point-min) (point-max))
:colorization-times colorization-times
:average-colorization-time (/ (apply #'+
colorization-times) 5)))
+ (elp-restore-all)
(kill-buffer)
(funcall callback))
+ ;; The last 5 runs are for gathering function call and
+ ;; duration statistics.
+ ((= count 5)
+ (elp-instrument-package "context-coloring-")
+ (context-coloring-colorize))
(t
(setq colorization-start-time (float-time))
(context-coloring-colorize))))))))
- [elpa] master updated (f89ef19 -> 61b8c49), Jackson Ray Hamilton, 2015/06/18
- [elpa] master c6cdb04 03/10: Benchmark coloring time separately.,
Jackson Ray Hamilton <=
- [elpa] master 296f07b 04/10: Update sexps per pause., Jackson Ray Hamilton, 2015/06/18
- [elpa] master 8536d5d 05/10: Use specified Emacs when running cask., Jackson Ray Hamilton, 2015/06/18
- [elpa] master 841aac4 02/10: Add eval-expression support., Jackson Ray Hamilton, 2015/06/18
- [elpa] master b19a0a2 06/10: Add predicate option for dispatches., Jackson Ray Hamilton, 2015/06/18
- [elpa] master 294b511 09/10: Version 6.5.0., Jackson Ray Hamilton, 2015/06/18
- [elpa] master 456f6e4 08/10: Use evm in build., Jackson Ray Hamilton, 2015/06/18
- [elpa] master 4eacc29 07/10: Update eval-expression recommendation for 24.3., Jackson Ray Hamilton, 2015/06/18
- [elpa] master 137a109 01/10: Fix bugs where parsing left point after a scope., Jackson Ray Hamilton, 2015/06/18
- [elpa] master 61b8c49 10/10: Merge commit '294b5117b42d2622f4fb0a1da219d45d98566b6e' from context-coloring, Jackson Ray Hamilton, 2015/06/18