Skip to content

Extremely slow indentation inside tables #197

Description

@cigumo

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions