Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely slow indentation inside tables #197

Open
cigumo opened this issue Nov 8, 2021 · 3 comments
Open

Extremely slow indentation inside tables #197

cigumo opened this issue Nov 8, 2021 · 3 comments

Comments

@cigumo
Copy link

cigumo commented Nov 8, 2021

I've just updated to the latest version in mepla (20210809) and it's extremely slow indenting tables.

Here's an example:

    100 = {a='b', c=2},
    101 = {a='b', c=2},
    102 = {a='b', c=2},
    ...  (500 more lines) 
}

It takes 40 seconds to indent it!

Here's a profiler report:

- command-execute                                               20021  89%
 - call-interactively                                           20021  89%
  - funcall-interactively                                       19931  88%
   - indent-region                                              19855  88%
    - indent-region-line-by-line                                19854  88%
     - indent-according-to-mode                                 19802  88%
      - lua-indent-line                                         19802  88%
       - lua-calculate-indentation                              19765  87%
        - lua-calculate-indentation-block-modifier              19677  87%
         - lua-calculate-indentation-info                       19677  87%
          - lua-is-continuing-statement-p                       19624  87%
           - lua-is-continuing-statement-p-1                    19605  87%
            - lua--backward-up-list-noerror                     19533  86%
             - lua-backward-up-list                             19512  86%
              - lua-find-matching-token-word                     9865  43%
               + lua-find-regexp                                 9584  42%
                 lua-get-block-token-info                          49   0%
              - lua-find-regexp                                  9419  41%
               - lua-comment-or-string-p                         9101  40%
                - syntax-ppss                                    8911  39%
                   #<compiled 0x1ff9b7316815>                       6   0%
                + lua-comment-start-pos                            34   0%
                match-string-no-properties                         48   0%
                lua-get-block-token-info                           34   0%
            + lua-last-token-continues-p                           29   0%
            + lua-forward-line-skip-blanks                         28   0%
            + lua--continuation-breaking-line-p                     9   0%
            + lua-first-token-continues-p                           6   0%
           + lua--goto-line-beginning-rightmost-closer                 16   0%
          + lua-calculate-indentation-info-1                       46   0%
            back-to-indentation                                     3   0%
        + lua-calculate-indentation-override                       60   0%
        + lua-forward-line-skip-blanks                             28   0%
       + lua-comment-or-string-p                                   36   0%
         back-to-indentation                                        1   0%
       progress-reporter-do-update                                 51   0%
   + execute-extended-command                                      76   0%

Thanks!

@cigumo
Copy link
Author

cigumo commented Nov 8, 2021

Tested in emacs 27.1 and 27.2 on a Mac.

@immerrr
Copy link
Owner

immerrr commented Nov 11, 2021

Hi,

I'll try to have a look at this over the weekend. Thank you for the report!

@cigumo
Copy link
Author

cigumo commented Nov 11, 2021

Thanks!!! It's really making my life miserable and I don't have time to fix it myself for the rest of the month. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants