-
Notifications
You must be signed in to change notification settings - Fork 23
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
Slow parsing of huge (26k+ lines) python files #103
Comments
Hi-Angel
added a commit
to Hi-Angel/color-identifiers-mode
that referenced
this issue
Feb 5, 2023
Do it by interrupting parsing if user is trying to do something. See also: ankurdave#103
Hi-Angel
added a commit
that referenced
this issue
Feb 5, 2023
Do it by interrupting parsing if user is trying to do something. See also: #103
Closed
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. |
Hi-Angel
changed the title
Slow parsing of huge (20k+ lines) python files
Slow parsing of huge (26k+ lines) python files
Feb 5, 2023
upd: changed the title to match up the timings in "steps-to-reproduce". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)The text was updated successfully, but these errors were encountered: