On Fri, 15 May 2020 06:06:00 -0000 "Brandt Bucher" <brandtbuc...@gmail.com> 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 -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/3ZQVQIGLAOFB47JXYHBVNIKUTOI2N7KH/ Code of Conduct: http://python.org/psf/codeofconduct/