----- Mail original ----- > De: "Carl Friedrich Bolz-Tereick" <cfb...@gmx.de> > À: "PIERRE AUGIER" <pierre.aug...@univ-grenoble-alpes.fr>, "PyPy Developer > Mailing List" <pypy-dev@python.org> > Envoyé: Jeudi 5 Juin 2025 09:53:42 > Objet: Re: [hpy-dev] Re: [pypy-dev] Re: [Numpy-discussion] Better > compatibility of the Python scientific/data stack with > fast Python interpreters
> Hi Pierre, > > so one thing you can definitely do without deep knowledge is bisect the > performance degradation. We have nightly builds here: > https://buildbot.pypy.org/nightly/ > > It's a little bit tedious work, but if it's such a clear slowdown, > finding out what broke this is useful. Thanks for the advice. Interestingly, I can confirm that there was a clear slowdown in the hpy-0.0.4 branch: fbfb93b991eb is indeed 3 times slower than 5a77b3ed145a (which is as slow as current PyPy). $ hg log -r fbfb93b991eb changeset: 106205:fbfb93b991eb branch: hpy-0.0.4 parent: 106198:bda034f1cbe8 user: Matti Picus <matti.pi...@gmail.com> date: Tue Oct 04 16:34:43 2022 +0300 summary: remove debug cruft $ hg log -r 5a77b3ed145a changeset: 106090:5a77b3ed145a branch: hpy-0.0.4 user: Matti Picus <matti.pi...@gmail.com> date: Thu Sep 08 23:42:01 2022 +0300 summary: refactor to make ztranslation work, skip debug tests that use closed handles Unfortunately, I can't bisect more from https://buildbot.pypy.org/nightly/hpy-0.0.4/ since there are no intermediate nightly builds. There are 114 commits between 5a77b3ed145a and fbfb93b991eb and the changes are quite large so I guess it would be nice to bisect a bit more (?). However, it's going to be long if I need to build PyPy for each try. Would it be possible to ask the build bot to build few commits between 5a77b3ed145a and fbfb93b991eb? For the record, few commands to get the results: ~/tmp/pypy-hpy0.0.4-c-jit-106209-fbfb93b991eb-linux64/bin/pypy -m venv .venv_pypy-hpy0.0.4-fbfb93b991eb . .venv_pypy-hpy0.0.4-fbfb93b991eb/bin/activate pip install pytest rm -rf build/ *.so python setup.py --hpy-abi=universal build_ext --inplace pytest -v test_microbench.py::TestType::test_allocate_obj and for HPy microbenchmarks, I use commit 1789d59dd1fb with these changes diff --git a/microbench/setup.py b/microbench/setup.py --- a/microbench/setup.py +++ b/microbench/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, Extension setup( name="hpy.microbench", - setup_requires=['hpy.devel', 'cffi'], + # setup_requires=['hpy.devel', 'cffi'], ext_modules = [ Extension('cpy_simple', ['src/cpy_simple.c'], diff --git a/microbench/src/hpy_simple.c b/microbench/src/hpy_simple.c --- a/microbench/src/hpy_simple.c +++ b/microbench/src/hpy_simple.c @@ -64,9 +64,7 @@ static HPy allocate_tuple_impl(HPyContex /* Foo type */ -typedef struct { - PyObject_HEAD -} FooObject; +typedef struct {} FooObject; > For more involved dev work, maybe it makes sense for us to set up a > video call and brainstorm a bit what you would be interested in and > would make strategic sense. I'm a bit busy with teaching still, but we > can probably find a slot. Send me a private mail if you want to do that? > > Cheers, > > CF > > On 2025-06-04 01:44, PIERRE AUGIER wrote: >> >> Hello, >> >> I'd like to try to work on this performance issue https://github.com/ >> pypy/pypy/issues/5277. It is about the fact that allocations of >> types defined with HPy are very slow compared to the CPython >> counterpart (typically 7 times slower). >> >> I think it is a key problem when considering a potential revival of >> the HPy project with new funding (which would help PyPy). >> >> Some data in old messages seem to indicate that it is at least >> partly a regression: it seems that PyPy was in Sept. 2022 only >> something like 2 times slower. >> >> I guess fixing issue #5277 is very technical and I realize that I >> might not be able to be efficient on this subject. However, I'm >> motivated to learn and I can spend a bit of time and energy on this >> subject. >> >> So I'm asking for some kind of mentoring. Matti and Carl Friedrich, >> I would need your point of view on this project. Is it even possible >> to try to do something about #5277 for someone who has only a >> superficial knowledge of PyPy internals? >> >> Then, where and how to start? I guess the first thing to do would be >> to try to understand why PyPy is so slow by profiling (?), studying >> traces (?) and/or studying PyPy code, in particular the HPy >> implementation? >> >> I'd like to be clear that it is just a proposition and that I >> realize that I'm asking for your time. If you think that it does not >> make sense to try to work on this direction (#5277, HPy in general), >> please tell me! >> > > Pierre _______________________________________________ pypy-dev mailing list -- pypy-dev@python.org To unsubscribe send an email to pypy-dev-le...@python.org https://mail.python.org/mailman3//lists/pypy-dev.python.org Member address: arch...@mail-archive.com