Message333497
The proposed PR makes multi-argument functions in the math module atan2(), copysign(), remainder() and hypot() to use the fast call convention and inline arguments tuple unpacking.
Results:
$ ./python -m timeit -s "from math import atan2" "atan2(1.0, 1.0)"
Unpatched: 5000000 loops, best of 5: 79.5 nsec per loop
Patched: 5000000 loops, best of 5: 66.1 nsec per loop
$ ./python -m timeit -s "from math import copysign" "copysign(1.0, 1.0)"
Unpatched: 5000000 loops, best of 5: 90.3 nsec per loop
Patched: 10000000 loops, best of 5: 35.9 nsec per loop
$ ./python -m timeit -s "from math import remainder" "remainder(1.0, 1.0)"
Unpatched: 5000000 loops, best of 5: 69.5 nsec per loop
Patched: 5000000 loops, best of 5: 44.5 nsec per loop
$ ./python -m timeit -s "from math import hypot" "hypot(1.0, 1.0)"
Unpatched: 5000000 loops, best of 5: 63.6 nsec per loop
Patched: 5000000 loops, best of 5: 47.4 nsec per loop |
|
Date |
User |
Action |
Args |
2019-01-11 18:17:27 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, mark.dickinson, vstinner, stutzbach |
2019-01-11 18:17:24 | serhiy.storchaka | set | messageid: <1547230644.92.0.865651994946.issue35719@roundup.psfhosted.org> |
2019-01-11 18:17:24 | serhiy.storchaka | link | issue35719 messages |
2019-01-11 18:17:24 | serhiy.storchaka | create | |
|