-
Notifications
You must be signed in to change notification settings - Fork 86
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
Support PyPy? #523
Comments
I agree with supporting PyPy. I also agree with their analysis of gmpy2_cache.c. The fix looks fine. |
On Tue, Oct 15, 2024 at 11:07:49PM -0700, casevh wrote:
The fix looks fine.
Cerntaily no. I think this kill mpz caching.
|
Maybe I shouldn't review code when I'm exhausted. 😩
On Tue, Oct 15, 2024 at 11:19 PM Sergey B Kirpichev <
***@***.***> wrote:
… On Tue, Oct 15, 2024 at 11:07:49PM -0700, casevh wrote:
> The fix looks fine.
Cerntaily no. I think this kill mpz caching.
—
Reply to this email directly, view it on GitHub
<#523 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMR23ZDRRMMZZ4E4IUGMODZ3YANJAVCNFSM6AAAAABQASNIROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJVHAZDONRVGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Performance of the CPyExt going better. Maybe we should add support for PyPy and run basic tests on CI to be sure it's working?
Here is a quick benchmark for multiplication (
python -m pyperf timeit -s 'from gmpy2 import fac,mpz;a=fac(mpz(100))' 'a*a'
):On CPython - gmpy2 looks 3.8x faster. It seems using C-API is still slower than CFFI, but not too much.
I think we can do this without too much special cases (see a draft patch below):
On a pros, PyPy people are working hard to make it's support for C-API "correct first". Maybe it helps us catch some bugs. E.g. now without patching the
gmpy2_cache.c
I got for above benchmark:Is this ok to manage cache in the
tp_dealloc
as we do?simple diff to compile and get some things working:
PS: ctypes/cffi toy implementations
The text was updated successfully, but these errors were encountered: