vue-html-mode icon indicating copy to clipboard operation
vue-html-mode copied to clipboard

Performance on large-ish files

Open AnharMiah opened this issue 8 years ago • 2 comments

Sorry @AdamNiederer its me again, everything has been working rather well after installing and using the vue-mode. :+1:

One thing that I have noticed however is that it seems to lag really badly and in some cases just freeze up when navigating around "large-ish" pages (in my case 2K+ lines files). :(

I'm sorry if I'm doing something totally noobish, I've only started learning emacs this week.

I ran a profile in emacs the report can be seen below:

image

Profile Report

- redisplay_internal (C function)                               37440  64%
 - linum-after-scroll                                           37426  64%
  - linum-update                                                37426  64%
   - mapc                                                       37426  64%
    - linum-update-window                                       37426  64%
     - window-end                                               37282  63%
      - jit-lock-function                                       37282  63%
       - jit-lock-fontify-now                                   37282  63%
        - jit-lock--run-functions                               37274  63%
         - run-hook-wrapped                                     37274  63%
          - #<compiled 0x3d2e59>                                37274  63%
           - font-lock-fontify-region                           37274  63%
            - mmm-fontify-region                                37274  63%
             - mapc                                             37274  63%
              - #<compiled 0x3c304f>                            37274  63%
               - mmm-fontify-region-list                        37274  63%
                - mapc                                          37274  63%
                 - #<compiled 0x3c30b5>                         37270  63%
                  - font-lock-default-fontify-region              37270  63%
                   - font-lock-fontify-keywords-region              36258  62%
                    + eval                                         23   0%
                      js--class-decl-matcher                       20   0%
                      font-lock-prepend-text-property                 15   0%
                      #<compiled 0xfcbc9f>                          4   0%
                   - font-lock-fontify-syntactically-region                535   0%
                      looking-back                                  8   0%
                   - font-lock-unfontify-region                   100   0%
                      font-lock-default-unfontify-region                100   0%
          #<compiled 0x113c5f1>                                     4   0%
       linum--face-width                                           38   0%
 - eval                                                            14   0%
  - if                                                             11   0%
     display-graphic-p                                              7   0%
    mode-line-eol-desc                                              3   0%
- command-execute                                               11177  19%
 + call-interactively                                           11173  19%
- linum-update-current                                           9009  15%
 - linum-update                                                  9005  15%
  - mapc                                                         9001  15%
   - linum-update-window                                         8858  15%
      linum--face-width                                           679   1%
      line-number-at-pos                                          240   0%
    + window-end                                                   24   0%
    get-buffer-window-list                                          4   0%
+ ...                                                             628   1%
+ mmm-update-submode-region                                        36   0%
  undo-auto--add-boundary                                           2   0%
  timer-event-handler 

Machine Stats

            .-/+oossssoo+/-.               anhar@thinkpad
        `:+ssssssssssssssssss+:`           --------------
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 16.04.3 LTS x86_64
    .ossssssssssssssssssdMMMNysssso.       Host: 2537RS2 ThinkPad T410
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 4.7.6-040706-generic
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 8 hours, 8 mins
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 2174
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 4.3.48
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 1440x900, 1920x1080
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   DE: GNOME
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: GNOME Shell
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   WM Theme: OSX-Arc-Darker-1.3.9
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Theme: OSX-Arc-Darker-1.3.9 [GTK2/3]
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Icons: La-capitaine-icon-theme-0.4.0 [GTK2/3]
  +sssssssssdmydMMMMMMMMddddyssssssss+     Terminal: emacs25
   /ssssssssssshdmNNNNmyNMMMMhssssss/      CPU: Intel i5 M 520 (4) @ 2.400GHz
    .ossssssssssssssssssdMMMNysssso.       GPU: Intel Ironlake Mobile
      -+sssssssssssssssssyyyssss+-         Memory: 2781MiB / 3753MiB
        `:+ssssssssssssssssss+:` 
            .-/+oossssoo+/-.                                       

AnharMiah avatar Dec 07 '17 17:12 AnharMiah

Try disabling linum-mode - it's notoriously CPU-heavy on large files. It looks like that's using up most of your CPU, as shown here:

- linum-after-scroll                                           37426  64%
... [snip] ...
- linum-update-current                                           9009  15%

The only function attributable directly to vue-mode in that stack is mmm-update-submode-region, which is using <1% of CPU time.

If you'd like line numbers, there is a much better implementation of line numbering on the latest git version of emacs. See here for more details: https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00318.html

AdamNiederer avatar Dec 07 '17 18:12 AdamNiederer

ah ok, I'll have a look and report back see if that makes a difference, I wonder if there is any other lighter numbering packages?

AnharMiah avatar Dec 07 '17 18:12 AnharMiah