This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
Date 2015-04-26.17:29:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430069389.87.0.288237546506.issue24059@psf.upfronthosting.co.za>
In-reply-to
Content
Timing results on my machine:

(Canopy 64bit) taniyama:~ mdickinson$ python3 -m timeit -s "from math import sqrt; x = 3.14" "sqrt(x)"
10000000 loops, best of 3: 0.0426 usec per loop
(Canopy 64bit) taniyama:~ mdickinson$ python3 -m timeit -s "from math import sqrt; x = 3.14" "x**0.5"
10000000 loops, best of 3: 0.0673 usec per loop

And the disassembly showing the peephole optimizer at work:

>>> def f(): return 3.14**0.5
... 
>>> import dis
>>> dis.dis(f)
  1           0 LOAD_CONST               3 (1.772004514666935)
              3 RETURN_VALUE
History
Date User Action Args
2015-04-26 17:29:49mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, serhiy.storchaka
2015-04-26 17:29:49mark.dickinsonsetmessageid: <1430069389.87.0.288237546506.issue24059@psf.upfronthosting.co.za>
2015-04-26 17:29:49mark.dickinsonlinkissue24059 messages
2015-04-26 17:29:49mark.dickinsoncreate