Hi Armin,

Couldn't that slowness of getattr be fixed by making the lib objects eg use 
module dicts or something?

Cheers,

Carl Friedrich

On September 26, 2018 9:47:10 PM GMT+02:00, Armin Rigo <armin.r...@gmail.com> 
wrote:
>Hi Dimitri,
>
>On Wed, 26 Sep 2018 at 21:19, Dimitri Vorona via pypy-dev
><pypy-dev@python.org> wrote:
>> In my microbenchmarks its has pretty much the same call performance
>as when using cffi ABI mode (dumping the functions to a shared library
>first) and is around 250ns per call slower than when using API mode.
>
>I doubt that these microbenchmarks are relevant.  But just in case, I
>found out that the JIT is producing two extra instructions in the ABI
>case, if you call ``lib.foobar()``.  These two instructions are caused
>by reading the ``foobar`` method on the ``lib`` object.  If you write
>instead ``foobar()``, with either ``foobar = lib.foobar`` or ``from
>_x_cffi.lib import foobar`` done earlier, then the speed is exactly
>the same.
>
>
>A bientôt,
>
>Armin.
>_______________________________________________
>pypy-dev mailing list
>pypy-dev@python.org
>https://mail.python.org/mailman/listinfo/pypy-dev
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to