Open Hi-Angel opened 1 year ago
I added a commit that interrupts parsing if a user becomes active, so from a user POV that problem doesn't really exists anymore. At this point it is more of a developer interest, e.g. for refactoring etc.
upd: changed the title to match up the timings in "steps-to-reproduce".
Steps to reproduce
wget https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/qutebrowser/browser/browsertab.py
1.py
file that is twenty times larger:for i in $(seq 1 20); do cat browsertab.py >> 1.py; done
1.py
file(benchmark-run 1 (color-identifiers:list-identifiers))
Expected
0.2 or 0.3 seconds
Actual
1.4 seconds
Additional information
benchmark-report
says that 70% of time is spent in internal Emacs function we call(sexp-at-point)
.So one solution to this problem could be optimizing this function.
Another good idea might be to modify upstream
python-mode
so that they mark args inside defuns with afont-lock-variable-name-face
face, which would allow to get rid ofcolor-identifiers:python-get-declarations
in preference of the genericcolor-identifiers:get-declarations
(well, maybe not completely, but at least for Emacs versions that will support that feature)