Well, I tried it. The result is interesting:
https://github.com/Marco-Sulla/cpython/blob/master/frozendict/test/bench_pyperf.txt

The main speedups are confirmed, and maybe also accentuated. But some
others are diminished or vanished. The most notable is pickle.dumps().

I have to say I did not really know why pickle.dumps() is faster on my pc
in "normal" conditions. I wrote the implementation of pickle.dumps() in
_pickle.c doing a quick copy/pasting of the dict and frozenset
implementations. Indeed pickle.loads() is really slow.

Furthermore, it seems that pyperf has not disabled ASLR. After `sudo python
-m pyperf system tune`, ASRL continues to be in "Full randomization" mode.

On Wed, 22 Jul 2020 at 07:48, Inada Naoki <songofaca...@gmail.com> wrote:

> On Wed, Jul 22, 2020 at 7:31 AM Marco Sulla
> <marco.sulla.pyt...@gmail.com> wrote:
> >
> > For benchmarks, I used simply timeit, with autorange and repeat and, as
> suggested in the module documentation, I got the minimum of the results.
> Here is the code:
> >
> >
> https://github.com/Marco-Sulla/cpython/blob/master/frozendict/test/bench.py
> >
>
> I strongly recommend to use pyperf for benchmarking.
> Otherwise, you will see random performance changes caused by random
> reasons including ASLR.
>
> https://pypi.org/project/pyperf/
> https://pyperf.readthedocs.io/en/latest/
>
> Regards,
> --
> Inada Naoki  <songofaca...@gmail.com>
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/OBZLFK2EB2GTITNJYHHZBQU2VSHYWRY5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to