Python: Why is IDLE so slow?
- by Adam Matan
Hi,
IDLE is my favorite Python editor. It offers very nice and intuitive Python shell which is extremely useful for unit-testing and debugging, and a neat debugger.
However, code executed under IDLE is insanely slow. By insanely I mean 3 orders of magnitude slow:
bash
time echo "for i in range(10000): print 'x'," | python
Takes 0.052s,
IDLE
import datetime
start=datetime.datetime.now()
for i in range(10000): print 'x',
end=datetime.datetime.now()
print end-start
Takes:
>>> 0:01:44.853951
Which is roughly 2,000 times slower.
Any thoughts, or ideas how to improve this? I guess it has something to do with the debugger in the background, but I'm not really sure.
Adam