-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Short circuit if all checks disabled #8715
Comments
Hello, are you using any particular libraries or code construct ? As it is it's going to be impossible to reproduce. |
The gpt4free repository was cloned in this project, I added it to ignore in the .pylintrc file. This reduced the running time by only 2 seconds. $ echo "\n" > test.py && time pylint test.py
************* Module test
test.py:1:2: E0001: Parsing failed: 'unexpected character after line continuation character (<unknown>, line 1)' (syntax-error)
real 0m1.639s
user 0m0.000s
sys 0m0.015s Checking the bot file (150 lines): $time pylint main.py
************* Module main
main.py:137:7: R0133: Comparison between constants: '0 == 1' has a constant value (comparison-of-constants)
main.py:147:0: C0116: Missing function or method docstring (missing-function-docstring)
------------------------------------------------------------------
Your code has been rated at 9.57/10 (previous run: 9.57/10, +0.00)
real 0m6.689s
user 0m0.000s
sys 0m0.031s There are no big files in the working directory. $ mkdir pylint-testing && cd pylint-testing
$ touch test.py
$ time pylint test.py --disable=all
real 0m1.616s
user 0m0.000s
sys 0m0.015s
$ time pylint test.py
real 0m1.592s
user 0m0.000s
sys 0m0.000s I don't think it's a problem of specific libraries. If you want me to share any logs or traces with you, let me know. |
I tested my code with flake8 and pycodestyle (aka pep8). There are results: $ time flake8 main.py
main.py:27:80: E501 line too long (80 > 79 characters)
main.py:66:80: E501 line too long (82 > 79 characters)
main.py:80:80: E501 line too long (88 > 79 characters)
main.py:97:80: E501 line too long (81 > 79 characters)
main.py:114:67: E261 at least two spaces before inline comment
main.py:114:80: E501 line too long (111 > 79 characters)
main.py:118:80: E501 line too long (83 > 79 characters)
main.py:123:67: E261 at least two spaces before inline comment
main.py:123:80: E501 line too long (111 > 79 characters)
main.py:125:80: E501 line too long (85 > 79 characters)
main.py:127:80: E501 line too long (88 > 79 characters)
main.py:135:80: E501 line too long (98 > 79 characters)
main.py:137:15: E261 at least two spaces before inline comment
main.py:143:80: E501 line too long (82 > 79 characters)
real 0m0.673s
user 0m0.000s
sys 0m0.000s $ time pycodestyle main.py
main.py:27:80: E501 line too long (80 > 79 characters)
main.py:66:80: E501 line too long (82 > 79 characters)
main.py:80:80: E501 line too long (88 > 79 characters)
main.py:97:80: E501 line too long (81 > 79 characters)
main.py:114:67: E261 at least two spaces before inline comment
main.py:114:80: E501 line too long (111 > 79 characters)
main.py:118:80: E501 line too long (83 > 79 characters)
main.py:123:67: E261 at least two spaces before inline comment
main.py:123:80: E501 line too long (111 > 79 characters)
main.py:125:80: E501 line too long (85 > 79 characters)
main.py:127:80: E501 line too long (88 > 79 characters)
main.py:135:80: E501 line too long (98 > 79 characters)
main.py:137:15: E261 at least two spaces before inline comment
main.py:143:80: E501 line too long (82 > 79 characters)
real 0m0.301s
user 0m0.015s
sys 0m0.000s I understand that pylint does a deeper analysis, but that shouldn't increase the check time by 6 seconds. |
Duplicate of #5933 @Pierre-Sassoulas ? |
Or pylint-dev/astroid#2161, but I don't think those perf issues are that bad so I suppose it's a pathological case on a specific lib / code construct and not a duplicate. |
Could you use a profiler like cProfile and post the result? You can profile: from pylint.lint import Run |
The size of the files is not material; it's what they import. If you import pandas, pylint is going to parse and replace the AST for pandas. That's going to take some time--it's part of pylint's distinct value proposition versus ruff, flake8, etc. That said, I've seen a sprinkle of bug reports about |
Bug description
Running "pylint test.py --disable=all" takes more than 3s!
$ touch test.py $ time pylint test.py --disable=all real 0m3.684s user 0m0.000s sys 0m0.015s
Running pylint without "disable=all" on a little project (150-lines telegram bot) takes more than 8s. It is non-usable.
Configuration
No response
Command used
Pylint output
Expected behavior
It is unacceptable that even on an empty file pylint runs for at least 3 seconds. I use the VS Code extension in my project, which for a small example with a 150-line project reacts to changes in 8 (!) seconds. This is literally impossible to use.
Pylint version
OS / Environment
Windows 11
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: