Skip to content
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

Very slow linting when using the dry-python/returns library #4750

Closed
MaybeJustJames opened this issue Jul 26, 2021 · 2 comments · Fixed by pylint-dev/astroid#1932
Closed
Labels
Lib specific 💅 This affect the code from a particular library Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning performance

Comments

@MaybeJustJames
Copy link

MaybeJustJames commented Jul 26, 2021

Bug description

Given a file a.py:

# pylint: disable=missing-module-docstring
from returns.maybe import Some

x = Some(1)

Command used

$ time poetry run python -m cProfile -s cumulative -o test.stats -m pylint a.py 

------------------------------------
Your code has been rated at 10.00/10


real	0m29.174s
user	0m28.799s
sys	0m0.088s

Expected behavior

I expect this to lint very quickly (within a second or 3).

Version affected

pylint 2.9.5
astroid 2.6.5
Python 3.8.9 (default, Apr  8 2021, 11:08:13) 
[GCC 10.2.1 20210110]

(OS / Environment)

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

Additional dependencies

Additional dependencies:

returns==0.16.0
@MaybeJustJames MaybeJustJames added Bug 🪲 Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jul 26, 2021
@MaybeJustJames
Copy link
Author

Relevant bug in the returns library: dry-python/returns#792

@MaybeJustJames
Copy link
Author

Output from cProfile above:
test.stats.zip

@Pierre-Sassoulas Pierre-Sassoulas added performance and removed Bug 🪲 Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jul 26, 2021
@Pierre-Sassoulas Pierre-Sassoulas added Lib specific 💅 This affect the code from a particular library Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning labels Jul 2, 2022
Pierre-Sassoulas pushed a commit to pylint-dev/astroid that referenced this issue Dec 31, 2022
When linting import returns.result from the returns library, generates 93,315 cache hits to 443 misses, cutting the total linting time from 50s to 12s.

Closes pylint-dev/pylint#4750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lib specific 💅 This affect the code from a particular library Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants