Skip to content

Compile pylint with mypyc to improve performance. #5933

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

Open
feluxe opened this issue Mar 18, 2022 · 4 comments
Open

Compile pylint with mypyc to improve performance. #5933

feluxe opened this issue Mar 18, 2022 · 4 comments
Labels
Enhancement ✨ Improvement to a component Needs PR This issue is accepted, sufficiently specified and now needs an implementation performance

Comments

@feluxe
Copy link

feluxe commented Mar 18, 2022

Current problem

pylint seems kinda slow.

When I run it with time on a 400 LOC file:

> time pylint smartctl-check.py
...
------------------------------------------------------------------
Your code has been rated at 8.45/10 (previous run: 8.45/10, +0.00)

smartctl-check.py  2.82s user 0.12s system 92% cpu 3.202 total

This is annoying when I cleanup warnings in my editor, because every time I fix one I have to wait 3 seconds until the warnings render again, in order to continue. This makes my Python workflow unsmooth, because I'm constantly waiting for the warnings to render.

Desired solution

Compile pylint with mypyc.

Additional context

I think black and mypy are compiled with mypyc.

The mypy project has been using mypyc to compile mypy since 2019, giving it a 4x performance boost over regular Python.

Maybe this would be an option for pylint is well?

Mypyc benchmarks look promising:

@feluxe feluxe added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Mar 18, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Discussion 🤔 Proposal 📨 performance and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Mar 18, 2022
@CarliJoy
Copy link
Contributor

CarliJoy commented May 4, 2022

I am fully in favour of this sugesstion.
See also:
https://glyph.twistedmatrix.com/2022/04/you-should-compile-your-python-and-heres-why.html

Probably we also need to compile astroid

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented May 4, 2022

We've got a long way to go before being able to do that, right now astroid cannot activate mypy even without --strict. The performance bottle neck is in astroid and astroid has less contributors and is harder to type than pylint. We welcome any contribution to the typing in both pylint and astroid. In pylint there's #2079, and pylint-dev/astroid#1287 for astroid.

@askfiy
Copy link

askfiy commented May 12, 2022

Totally agree, pylint is really slow these days. but i love it...

@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component and removed Proposal 📨 Discussion 🤔 labels May 13, 2022
@Pierre-Sassoulas Pierre-Sassoulas added the Needs design proposal 🔒 This is a huge feature, some discussion should happen before a PR is proposed label Jul 8, 2022
@Pierre-Sassoulas
Copy link
Member

The typing is fully done in pylint, we might have some benefits already, no idea how much. It's certainly not going to hurt if we try.

@Pierre-Sassoulas Pierre-Sassoulas added Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs design proposal 🔒 This is a huge feature, some discussion should happen before a PR is proposed labels Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component Needs PR This issue is accepted, sufficiently specified and now needs an implementation performance
Projects
None yet
Development

No branches or pull requests

4 participants