[issue18252] timeit makes code run faster?

2013-06-18 Thread icedream91
New submission from icedream91: I used Python 3.3.2 to try this problem: http://projecteuler.net/problem=23 , and I got a correct answer. When I wanted to check how long it took, I found something strange: When I ran 23.py directly, it showed that it took about 13s. But if I use timeit

[issue18252] timeit makes code run faster?

2013-06-18 Thread icedream91
Changes by icedream91 icedrea...@gmail.com: Removed file: http://bugs.python.org/file30633/23.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18252 ___

[issue18252] timeit makes code run faster?

2013-06-18 Thread icedream91
icedream91 added the comment: I used Python 3.3.2 to try this problem: http://projecteuler.net/problem=23 , and I got a correct answer. When I wanted to check how long it took, I found something strange: When I ran 23.py directly, it showed that it took about 13s. But if I use timeit module,

[issue18252] timeit makes code run faster?

2013-06-18 Thread Richard Oudkerk
Richard Oudkerk added the comment: I think if you use timeit then the code is wrapped inside a function before it is compiled. This means that your code can mostly use faster local lookups rather than global lookups. -- nosy: +sbt ___ Python

[issue18252] timeit makes code run faster?

2013-06-18 Thread icedream91
icedream91 added the comment: I did some tests, Richard Oudkerk (sbt) is right. Thanks a lot. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18252 ___

[issue18252] timeit makes code run faster?

2013-06-18 Thread R. David Murray
R. David Murray added the comment: By the way, this kind of question is more suited to the python-list mailing list (where you will in the general case get a faster answer anyway :) -- nosy: +r.david.murray stage: - committed/rejected status: open - closed

[issue18252] timeit makes code run faster?

2013-06-18 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- stage: committed/rejected - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18252 ___ ___

[issue18252] timeit makes code run faster?

2013-06-18 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18252 ___ ___