Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

imenu is way too slow #135

@asmeurer

Description

@asmeurer

For a reasonably sized Python file (for example, a single class with 100 methods, where the file is about 1500 lines long), it takes 3 seconds to run python-imenu-prev-index-position with emacs -Q (according to elp), and a full imenu takes over 15 seconds with my complete configuration (clearly there's something else going on in my complete configuration, but this is a good place to start).

Here's the profiling results for my complete profile

python-info-current-defun                      260         16.116206999  0.0619854115
python-nav-end-of-defun                        264         9.3584680000  0.0354487424
python-imenu-prev-index-position               131         8.1096539999  0.0619057557
python-nav-end-of-statement                    40950       6.6539469999  0.0001624895
python-nav-beginning-of-defun                  15462       6.4952520000  0.0004200783
python-nav--beginning-of-defun                 15462       6.4294110000  0.0004158201
python-syntax-context-type                     63184       3.6582260000  5.789...e-05
python-util-forward-comment                    41214       2.2133439999  5.370...e-05
python-info-line-ends-backslash-p              41222       2.1830099999  5.295...e-05
python-info-looking-at-beginning-of-defun      46916       1.3367139999  2.849...e-05
python-nav-beginning-of-statement              272         0.0217740000  8.005...e-05
python-syntax-stringify                        16          0.000931      5.81875e-05
python-nav-backward-block                      6           0.000856      0.0001426666
python-nav-forward-block                       6           0.000839      0.0001398333

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