Message117720
| Author |
skrah |
| Recipients |
Kiriakos.Vlahos, brian.curtin, eric.smith, loewis, mark.dickinson, sjmachin, skrah |
| Date |
2010年09月30日.11:07:05 |
| SpamBayes Score |
0.002562315 |
| Marked as misclassified |
No |
| Message-id |
<1285844832.57.0.987060669081.issue9980@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I benchmarked _PyOS_ascii_strtod without the macros, with the macros
and with always calling both fnstcw/fldcw. There is no real difference:
import timeit
s = "str(38210.0)"
t = timeit.Timer(stmt=s)
t.timeit(number=10000000)
t.timeit(number=10000000)
t.timeit(number=10000000)
# None
>>> t.timeit(number=10000000)
3.7519991397857666
>>> t.timeit(number=10000000)
3.759944200515747
>>> t.timeit(number=10000000)
3.7730538845062256
>>>
# Macros
>>> t.timeit(number=10000000)
3.780745029449463
>>> t.timeit(number=10000000)
3.777444839477539
>>> t.timeit(number=10000000)
3.7622230052948
# fnstcw/fldcw
>>> t.timeit(number=10000000)
3.765655994415283
>>> t.timeit(number=10000000)
3.7517099380493164
>>> t.timeit(number=10000000)
3.749257802963257 |
|