Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Poor performance when `display-line-numbers` is set to `visual`

Offen
#657 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
emacs, emacs-lisp, php
Bereich
performance, tooling

Rechercherichtung

Beginnen Sie damit, die Verlangsamung bei der Eingabe in php-mode zu reproduzieren, wenn display-line-numbers auf 'visual gesetzt ist, und untersuchen Sie anschließend die profilierten Einstiegspunkte php-syntax-propertize-hash-line-comment, syntax-propertize und line-move. Vergleichen Sie das Verhalten mit 'relative und bestätigen Sie, dass sich die Eingabeleistung nicht mehr proportional zur Pufferlänge verschlechtert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Emacs Lisp
Sterne
606
Forks
117
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus emacs-php/php-mode

Alle Issues in emacs-php/php-mode

Ähnliche Issues

Weitere Issues zu Performance

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.