This blog post gives a good performance analysis.
pylint
analyzes every line of code for two things:
- the code itself, obviously,
- the message control, also called pragma, i.e. comments like
# pylint: disable=line-too-long
.
While pragmas are a nice feature to add linter exceptions, they come to the expense of a more complex logic.
Moreover, this features triggers additional checks when the line is too long, and when the module contains too many lines (source code as of Jan. 2023).
While I can fix my code, I cannot control the libraries I import.
For instance, pandas has modules of 12k lines.
My workaround - Increase the max-line-length
and max-module-lines
parameters in .pylintrc
, e.g. to 200 and 15000.
No miracle here, but a visible improvement (not measured).
Note - Using -j
or setting jobs
does not work for me because it is used to process modules in parallel.
It does not accelerate the linting of a single file, and syntastic calls the pylint on the current file only.