Skip to content

[Bug]: GraalPy math.isqrt is slow #1020

Description

@skirpichev

Describe the bug

I tried to enable GraalPy in Github Actions to run the mpmath test suite, but tests runs enormously slow (more 6 hours, and CI job timeouts):
https://github.com/mpmath/mpmath/actions/runs/29463728468/job/87512994527

c.f. ~6-7min for PyPy/CPython. Mpmath heavily uses integer arithmetic, though in CI tests most operands are machine-sized (~99% of <= 53bits). That's why tests on PyPy are slightly faster, when using builtin integers.

I didn't run tests on GMP-based backends (using python-gmp or gmpy2 packages for integer arithmetics), but I expect that situation here will be only worse.

Operating system

Linux

CPU architecture

x86_64

GraalPy version

25.1.3

JDK version

No response

Context configuration

No response

Steps to reproduce

Install mpmath:
https://mpmath.readthedocs.io/en/latest/setup.html#download-and-installation
Run test suite:
https://mpmath.readthedocs.io/en/latest/setup.html#running-tests

Expected behavior

This depends on hardware, but in Github Actions full test suite using builtin integers as integer math backend - takes ~8min on CPython 3.14 and ~6min on PyPy.

It would expect, that GraalPy might be slower. But not for several orders of magnitude...

Stack trace

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions