最近发现在WSL1 GUI下用Doom Emacs处理稍微大量的中文就会卡顿,比如移动光标有肉眼可见的卡顿。
试了以下几种方法试图解决问题但都没有明显效果:
-
修改GC:
(setq gc-cons-threshold (* 512 1024 1024)) (setq gc-cons-percentage 0.5) (run-with-idle-timer 5 t #'garbage-collect)
-
修改字体:
用过文泉驿微米黑、微软雅黑以及微软宋体。
很好奇各位大佬在Linux下处理中文不卡吗?
贴下使用环境:
WSL1 Ubuntu 18.04.4 LTS
Emacs version: GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-09-17
Doom Emacs version: Doom v2.0.9 develop be396655c45b8ca9b05bbf585385cd17d74a58c1
Profiler report:
测试方法:开了一个Fundamental的buffer,里面放了20行中文,然后对这些中文进行编辑。结果如下。
CPU:
- command-execute 4234 77%
- call-interactively 4234 77%
- funcall-interactively 3995 73%
- counsel-M-x 3478 63%
- ivy-read 3454 63%
+ read-from-minibuffer 95 1%
+ ivy--reset-state 4 0%
+ ivy-call 1 0%
+ counsel--M-x-externs 24 0%
- evil-previous-line 326 5%
+ evil-line-move 326 5%
- evil-next-line 87 1%
+ evil-line-move 87 1%
+ evil-normal-state 63 1%
+ evil-delete-char 18 0%
+ evil-delete 11 0%
+ handle-focus-in 5 0%
+ evil-visual-char 3 0%
+ evil-forward-word-end 2 0%
+ evil-insert 1 0%
+ evil-yank 1 0%
+ byte-code 238 4%
- ... 1160 21%
Automatic GC 1160 21%
+ redisplay_internal (C function) 32 0%
+ timer-event-handler 14 0%
+ evil-repeat-pre-hook 3 0%
+ winner-save-old-configurations 3 0%
+ evil-visual-post-command 3 0%
+ evil-repeat-post-hook 2 0%
+ evil--jump-hook 1 0%
+ evil-escape-pre-command-hook 1 0%
+ xselect-convert-to-string 1 0%
Mem:
- command-execute 15,647,376 60%
- call-interactively 15,646,320 60%
- funcall-interactively 13,950,980 53%
- counsel-M-x 6,078,038 23%
- ivy-read 6,030,494 23%
+ read-from-minibuffer 4,500,063 17%
+ ivy-call 1,217,135 4%
+ ivy--reset-state 93,638 0%
+ ivy--update-prompt 1,024 0%
counsel--M-x-externs 47,544 0%
- evil-previous-line 5,062,464 19%
+ evil-line-move 5,062,464 19%
- evil-next-line 2,572,097 9%
+ evil-line-move 2,572,097 9%
+ evil-insert 63,597 0%
+ evil-visual-char 54,616 0%
+ evil-delete 46,984 0%
+ handle-focus-in 40,052 0%
+ evil-delete-char 8,148 0%
+ evil-delete-backward-char-and-join 6,720 0%
+ evil-backward-char 6,336 0%
+ evil-forward-char 3,168 0%
+ evil-paste-after 3,168 0%
+ evil-normal-state 2,224 0%
+ evil-yank 1,256 0%
+ evil-forward-word-end 1,056 0%
+ byte-code 1,694,284 6%
- ... 6,391,983 24%
+ pop-to-buffer 6,299,639 24%
+ #<lambda 0x374f1716630a6> 90,272 0%
+ annalist--record-record 2,072 0%
+ redisplay_internal (C function) 3,384,721 13%
+ timer-event-handler 221,709 0%
+ winner-save-old-configurations 127,160 0%
+ evil-visual-post-command 43,036 0%
+ xselect-convert-to-targets 12,408 0%
+ xselect-convert-to-string 6,794 0%
+ evil-repeat-pre-hook 2,112 0%
+ evil-escape-pre-command-hook 2,048 0%
+ internal-echo-keystrokes-prefix 1,056 0%
list 1,040 0%
internal-timer-start-idle 876 0%
describe-char:
position: 8367 of 85084 (10%), column: 72
character: 是 (displayed as 是) (codepoint 26159, #o63057, #x662f)
charset: unicode (Unicode (ISO10646))
code point in charset: 0x662F
script: han
syntax: w which means: word
category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable
to input: type "C-x 8 RET 662f"
buffer code: #xE6 #x98 #xAF
file code: #xE6 #x98 #xAF (encoded by coding system utf-8)
display: by this font (glyph code)
xft:-1ASC-Droid Sans Fallback-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x33C7)
Character code properties: customize what to show
name: CJK IDEOGRAPH-662F
general-category: Lo (Letter, Other)
decomposition: (26159) ('是')