Poor performance when `display-line-numbers` is set to `visual`
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- emacs, emacs-lisp, php
- 领域
- performance, tooling
调研方向
首先,在将 display-line-numbers 设置为 'visual 的情况下复现 php-mode 中的输入速度下降,然后检查经过性能分析的入口点 php-syntax-propertize-hash-line-comment、syntax-propertize 和 line-move。将其行为与 'relative 进行比较,并确认输入性能不再随缓冲区长度成比例地下降。
由索引模型根据 Issue 内容生成。
描述
When using php-mode, if display-line-numbers is set to 'visual then the performance when typing is very poor. The problem gets worse proportionally to the number of buffer lines; in my case it becomes noticeable when the buffer gets to around 30 lines.
Here is a profile when set to 'visual: -
- command-execute 291 88%
- call-interactively 291 88%
- funcall-interactively 291 88%
- self-insert-command 273 82%
- c-after-change 138 41%
- c-trim-found-types 138 41%
- c-beginning-of-current-token 138 41%
- skip-syntax-backward 138 41%
- internal--syntax-propertize 138 41%
- syntax-propertize 138 41%
- php-syntax-propertize-function 138 41%
- php-syntax-propertize-hash-line-comment 138 41%
- move-beginning-of-line 137 41%
- line-move 137 41%
line-move-1 137 41%
- electric-pair-post-self-insert-function 135 41%
- electric-pair-syntax-info 135 41%
- syntax-ppss 135 41%
- parse-partial-sexp 135 41%
- internal--syntax-propertize 135 41%
- syntax-propertize 135 41%
- php-syntax-propertize-function 135 41%
- php-syntax-propertize-hash-line-comment 134 40%
- move-beginning-of-line 134 40%
- line-move 134 40%
line-move-1 134 40%
+ counsel-M-x 18 5%
Here is a profile when set to 'relative: -
- command-execute 75 70%
- call-interactively 75 70%
- funcall-interactively 75 70%
- self-insert-command 55 51%
- electric-pair-post-self-insert-function 29 27%
- electric-pair-syntax-info 29 27%
- syntax-ppss 29 27%
- parse-partial-sexp 29 27%
- internal--syntax-propertize 29 27%
- syntax-propertize 29 27%
- php-syntax-propertize-function 29 27%
- php-syntax-propertize-hash-line-comment 29 27%
- move-beginning-of-line 29 27%
- line-move 29 27%
- line-move-1 29 27%
- vertical-motion 4 3%
- jit-lock-function 4 3%
- jit-lock-fontify-now 4 3%
- jit-lock--run-functions 4 3%
- run-hook-wrapped 4 3%
- #<compiled 0x157529864965> 4 3%
- font-lock-fontify-region 4 3%
- c-font-lock-fontify-region 4 3%
- font-lock-default-fontify-region 3 2%
- font-lock-fontify-keywords-region 2 1%
- #<compiled 0x1575295055fd> 1 0%
- c-beginning-of-decl-1 1 0%
- c-beginning-of-statement-1 1 0%
c-beginning-of-macro 1 0%
- c-before-context-fl-expand-region 1 0%
- mapc 1 0%
- #<compiled 0x157529228b15> 1 0%
- c-context-expand-fl-region 1 0%
- c-fl-decl-end 1 0%
c-backward-sws 1 0%
- c-after-change 26 24%
- c-trim-found-types 26 24%
- c-beginning-of-current-token 26 24%
- skip-syntax-backward 26 24%
- internal--syntax-propertize 26 24%
- syntax-propertize 26 24%
- php-syntax-propertize-function 26 24%
- php-syntax-propertize-hash-line-comment 26 24%
- move-beginning-of-line 26 24%
- line-move 26 24%
line-move-1 25 23%
+ counsel-M-x 19 17%
+ evil-normal-state 1 0%
+ ... 30 28%
+ redisplay_internal (C function) 1 0%
+ timer-event-handler 1 0%
I am using GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-28
- 主要语言
- Emacs Lisp
- 星标
- 606
- 派生
- 117
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
emacs-php/php-mode 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 20/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 38/100
查看 emacs-php/php-mode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/ch-go#1218 ·
维护者通常 13 天内回复
-
Restore runs its two nvidia-smi calls one after the other before CRIU可能已有人在做 @galletas1712 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 2 天内回复
-
ai-generated
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
good first issue hacktoberfest v0.2
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复