emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master b485897 186/271: Update benchmarks.


From: Jackson Ray Hamilton
Subject: [elpa] master b485897 186/271: Update benchmarks.
Date: Thu, 05 Feb 2015 18:31:03 +0000

branch: master
commit b485897a792781ace392951f8fe5f9f255b632fe
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Update benchmarks.
---
 README.md           |   10 +++++-----
 context-coloring.el |   12 +++++++++++-
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 7e96bb7..9536242 100644
--- a/README.md
+++ b/README.md
@@ -32,11 +32,11 @@ code*.
 
 - Supported languages: JavaScript
 - Light and dark (customizable) color schemes.
-- Fast async AST parsing. Some total parse + recolor times:
-  - jQuery (9191 lines): 0.63 seconds
-  - Lodash (6786 lines): 0.37 seconds
-  - Async (1124 lines): 0.17 seconds
-  - mkdirp (98 lines): 0.09 seconds
+- Fast AST parsing. Some total parse + recolor times:
+  - jQuery (9191 lines): 0.43 seconds (js2-mode), 0.63 seconds (js-mode)
+  - Lodash (6786 lines): 0.19 seconds (js2-mode), 0.37 seconds (js-mode)
+  - Async (1124 lines): 0.05 seconds (js2-mode), 0.17 seconds (js-mode)
+  - mkdirp (98 lines): 0.005 seconds (js2-mode), 0.09 seconds (js-mode)
 
 ## Usage
 
diff --git a/context-coloring.el b/context-coloring.el
index 830fd98..ea62a28 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -67,6 +67,11 @@ ES6. If you are writing ES6 code, enable this; otherwise, 
don't.
 Supported modes: `js2-mode'"
   :group 'context-coloring)
 
+(defcustom context-coloring-benchmark-colorization nil
+  "If non-nil, track how long colorization takes and print
+messages with the colorization duration."
+  :group 'context-coloring)
+
 
 ;;; Local variables
 
@@ -416,7 +421,12 @@ of the current buffer, then does it."
 (defun context-coloring-colorize (&optional callback)
   "Colors the current buffer by function context."
   (interactive)
-  (context-coloring-dispatch callback))
+  (let ((start-time (float-time)))
+    (context-coloring-dispatch
+     (lambda ()
+       (when context-coloring-benchmark-colorization
+         (message "Colorization took %.3f seconds" (- (float-time) 
start-time)))
+       (if callback (funcall callback))))))
 
 (defun context-coloring-change-function (_start _end _length)
   "Registers a change so that a context-colored buffer can be



reply via email to

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