[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 099f434 082/271: Add optimizations for byte-compilation.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 099f434 082/271: Add optimizations for byte-compilation. |
Date: |
Thu, 05 Feb 2015 18:29:56 +0000 |
branch: master
commit 099f434165d315d53828ec9d7fda18b445ee4942
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Add optimizations for byte-compilation.
---
Makefile | 2 +-
context-coloring.el | 28 +++++++++++++++-------------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile
index 4a369d5..5c8affc 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,6 @@ benchjs:
node_modules/.bin/matcha
benchel:
- emacs -Q -l context-coloring.el -l benchmark/scenarios.el
+ emacs -Q -L . -l context-coloring -l benchmark/scenarios.el
.PHONY: all test benchmark
diff --git a/context-coloring.el b/context-coloring.el
index 8be5ff3..ab4dcde 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -134,7 +134,7 @@ Determines depth at which to cycle through faces again.")
;;; Face functions
-(defun context-coloring-level-face (depth style)
+(defsubst context-coloring-level-face (depth style)
"Return face-name for DEPTH and STYLE as a string
\"context-coloring-depth-DEPTH-face\".
For example: \"context-coloring-depth-1-face\"."
(intern-soft
@@ -160,7 +160,8 @@ For example: \"context-coloring-depth-1-face\"."
(defcustom context-coloring-delay 0.25
"Delay between a buffer update and colorization.
-If your performance is poor, you might want to increase this.")
+If your performance is poor, you might want to increase this."
+ :group 'context-coloring)
;;; Local variables
@@ -183,9 +184,9 @@ is a reference to that one process.")
imply that it should be colorized again.")
(make-variable-buffer-local 'context-coloring-changed)
-(defvar context-coloring-colorize-start-time nil
- "Used for dirty benchmarking of async colorization time.")
-(make-variable-buffer-local 'context-coloring-colorize-start-time)
+;; (defvar context-coloring-colorize-start-time nil
+;; "Used for dirty benchmarking of async colorization time.")
+;; (make-variable-buffer-local 'context-coloring-colorize-start-time)
;;; Scopification
@@ -198,7 +199,7 @@ imply that it should be colorized again.")
(expand-file-name "./bin/scopifier" context-coloring-path)
"Path to the external scopifier executable.")
-(defun context-coloring-apply-tokens (tokens)
+(defsubst context-coloring-apply-tokens (tokens)
"Processes TOKENS to apply context-based coloring to the
current buffer. Tokens are vectors consisting of 4 integers:
start, end, level, and style."
@@ -216,18 +217,18 @@ start, end, level, and style."
(elt tokens (+ i 3))) rear-nonsticky t))
(setq i (+ i 4))))))
-(defun context-coloring-kill-scopifier ()
+(defsubst context-coloring-kill-scopifier ()
"Kills the currently-running scopifier process for this
buffer."
(when (not (null context-coloring-scopifier-process))
(delete-process context-coloring-scopifier-process)
(setq context-coloring-scopifier-process nil)))
-(defun context-coloring-parse-array (input)
+(defsubst context-coloring-parse-array (input)
"Specialized alternative JSON parser."
(vconcat (mapcar 'string-to-number (split-string (substring input 1 -1)
","))))
-(defun context-coloring-scopify ()
+(defsubst context-coloring-scopify ()
"Invokes the external scopifier with the current buffer's
contents, reading the scopifier's response asynchronously and
applying a parsed list of tokens to
@@ -243,7 +244,8 @@ applying a parsed list of tokens to
(let ((output "")
(buffer context-coloring-buffer)
- (start-time context-coloring-colorize-start-time))
+ ;; (start-time context-coloring-colorize-start-time)
+ )
;; The process may produce output in multiple chunks. This filter
;; accumulates the chunks into a message.
@@ -260,7 +262,7 @@ applying a parsed list of tokens to
(with-current-buffer buffer
(context-coloring-apply-tokens tokens))
(setq context-coloring-scopifier-process nil)
- (message "Colorized (after %f seconds)." (-
(float-time) start-time))
+ ;; (message "Colorized (after %f seconds)." (-
(float-time) start-time))
)))))
;; Give the process its input.
@@ -273,8 +275,8 @@ applying a parsed list of tokens to
(defun context-coloring-colorize ()
"Colors the current buffer by function context."
(interactive)
- (setq context-coloring-colorize-start-time (float-time))
- (message "%s" "Colorizing.")
+ ;; (setq context-coloring-colorize-start-time (float-time))
+ ;; (message "%s" "Colorizing.")
(context-coloring-scopify))
(defun context-coloring-change-function (start end length)
- [elpa] master 183ac4e 081/271: Add emacs benchmark., (continued)
- [elpa] master 183ac4e 081/271: Add emacs benchmark., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 59b1c99 074/271: Documentation and cleanup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c81c3fd 068/271: Make declarations bold., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f9eb4a1 080/271: Revert "Use alist of faces.", Jackson Ray Hamilton, 2015/02/05
- [elpa] master ea3fd79 071/271: Make implicit global variables bold., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1039a74 073/271: Update microoptimized version., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 18e35dd 069/271: Shift token properties., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 49f5e3e 079/271: Use alist of faces., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 8615688 089/271: Create tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 10d7726 077/271: Use custom JSON parser., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 099f434 082/271: Add optimizations for byte-compilation.,
Jackson Ray Hamilton <=
- [elpa] master 0bfdbcd 085/271: Remove naive timers., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4874e1e 086/271: Improve documentation and Makefile., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 43d2ca0 090/271: Remove unused monad., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 820becb 084/271: Fix test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fb57258 088/271: Reorder readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 426a7cd 083/271: Fix regression where existent definitions were missed., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f8120d4 092/271: Update scenarios. Update readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f50880d 091/271: Update header., Jackson Ray Hamilton, 2015/02/05
- [elpa] master a0139c3 087/271: Cleanup Makefile., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f3e4d7b 094/271: Improve benchmarks., Jackson Ray Hamilton, 2015/02/05