用的是spacemacs, 平台是macos, 版本信息:
GNU Emacs 28.1 (build 1, x86_64-apple-darwin19.6.0, Carbon Version 162 AppKit 1894.6)
of 2022-04-28
在R代码块中, 输入字符延迟明显, 用o创建下一行延迟明显. 关闭了evil-auto-indent
.
我用profiler得到的结果如下:
11325 100% - ...
11089 97% - funcall-interactively
11089 97% - spacemacs/helm-M-x-fuzzy-matching
11089 97% - let
11089 97% - call-interactively
11089 97% - funcall-interactively
11089 97% - helm-M-x
11089 97% - helm-M-x-read-extended-command
11088 97% - helm
11088 97% - apply
9744 86% + ad-Advice-eval-last-sexp
1344 11% + helm
1 0% - helm-make-source
1 0% + apply
236 2% Automatic GC
可以看到, 主要是spacemacs/helm-M-x-fuzzy-matching
, 可是我可以做点什么呢? 为什么偏偏是在代码块?
在代码块之外, profiler的结果是:
27277 98% - command-execute
27277 98% - call-interactively
27277 98% - funcall-interactively
27277 98% - eval-last-sexp
27277 98% - apply
27277 98% - ad-Advice-eval-last-sexp
27277 98% - esf-flash-doit
27277 98% - eval-sexp-fu-flash-doit
27277 98% + eval-sexp-fu-flash-doit-simple