[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020年5月15日 09:11:29 -0700

On 2020年5月15日 06:06:00 -0000
"Brandt Bucher" <[email protected]> wrote:
> Ethan Furman wrote:
> > Can you do those with _pydecimal? If performance were an issue anywhere I 
> > would expect to see it with number crunching. 
> 
> No difference, probably because those methods look like they spend most of 
> their time doing string manipulation:
[ snip micro-benchmarks ]
And in any case, people who are concerned about performance should use
the C decimal accelerator, which is the default.
Here is your micro-benchmark with _pydecimal (which is the pure Python
fallback):
 $ python3.8 -m pyperf timeit -s "$PYPERFSETUP" "$PYPERFRUN"
 .....................
 Mean +- std dev: 35.4 us +- 1.1 us
Here is the same micro-benchmark with decimal (which loads the C
accelerator by default):
 $ python3.8 -m pyperf timeit -s "$PYPERFSETUP" "$PYPERFRUN"
 .....................
 Mean +- std dev: 471 ns +- 12 ns
Even if you were losing performance on those 35.4us it wouldn't make
sense to complain about it.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/3ZQVQIGLAOFB47JXYHBVNIKUTOI2N7KH/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to