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

Slow performance with large numbers #6745

Closed
ywanHK opened this issue May 29, 2022 · 1 comment · Fixed by pylint-dev/astroid#1610
Closed

Slow performance with large numbers #6745

ywanHK opened this issue May 29, 2022 · 1 comment · Fixed by pylint-dev/astroid#1610
Labels
Astroid Related to astroid Good first issue Friendly and approachable by new contributors performance
Milestone

Comments

@ywanHK
Copy link

ywanHK commented May 29, 2022

Bug description

I'm currently working with a project that involves calculations of large numbers.

If I have a file named test.py containing the single line:

test0 = 15 ** 20220529

It takes on average 1 minute to produce any output

Configuration

No response

Command used

python3 -m pylint test.py

Pylint output

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

Expected behavior

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

Pylint version

pylint 2.12.2
astroid 2.9.3
Python 3.9.7 (default, Sep 23 2021, 09:13:41)  [GCC 10.3.0 64 bit (AMD64)]

OS / Environment

MSYS2 MinGW-64

Additional dependencies

No response

@ywanHK ywanHK added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label May 29, 2022
@jacobtylerwalls
Copy link
Member

We do actually perform the math here: https://github.com/PyCQA/astroid/blob/152083468dffb8ede7465f7f0250d081b8da3523/astroid/protocols.py#L119.

** certainly seems like the most dangerous operator. Would you be interested in proposing a reasonable limit and submitting a patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Astroid Related to astroid Good first issue Friendly and approachable by new contributors performance
Projects
2 participants