diff options
| author | Nick Drozd <nicholasdrozd@gmail.com> | 2019-01-01 18:50:59 -0600 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2019-01-08 00:38:36 +0000 |
| commit | cfda60fdf2c8181ee2a96daf7d7a1c10d2f36eed (patch) | |
| tree | 7fd23ceda83b07b7ee5e9d25cce3c902c630b8b2 /test | |
| parent | 2c6576f731282209492ca7c0217346deb9666785 (diff) | |
Cut repeated calls to helpful--aliases
helpful--aliases is expensive, so as usual we'll call it just once at
the beginning of helpful-update. This sacrifices a little elegance for
a significant peformance boost. Here are before and after times
running (helpful-callable #'move-beginning-of-line) 50 times on my
crappy little Thinkpad:
Before:
Elapsed time: 61.507899s (23.391894s in 148 GCs)
Elapsed time: 56.855148s (24.392109s in 133 GCs)
Elapsed time: 58.082409s (25.796263s in 146 GCs)
After:
Elapsed time: 43.519486s (17.412847s in 95 GCs)
Elapsed time: 43.171007s (17.036012s in 92 GCs)
Elapsed time: 44.725709s (18.705316s in 102 GCs)
So the time per call goes from a little over a second to a little
under a second.
Diffstat (limited to 'test')
| -rw-r--r-- | test/helpful-unit-test.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/helpful-unit-test.el b/test/helpful-unit-test.el index bf5a2f1..95c3e3c 100644 --- a/test/helpful-unit-test.el +++ b/test/helpful-unit-test.el @@ -612,7 +612,7 @@ in." (global-set-key (kbd "C-c M-S-d") #'helpful--dummy-command-alias) (unwind-protect - (let* ((keymaps (helpful--keymaps-containing-aliases #'helpful--dummy-command)) + (let* ((keymaps (helpful--keymaps-containing-aliases #'helpful--dummy-command (helpful--aliases 'helpful--dummy-command t))) (global-keybindings (cdr (assoc "global-map" keymaps)))) (should (equal global-keybindings (list "C-c M-S-c" "C-c M-S-d")))) |
