Is it just me, or is Python s l o o o w when compared to Perl?
I have two scripts, attached. They do EXACTLY the same thing in almost EXACTLY the same manner, but the Python script is almost 25 times slower than the Perl script:
$ time bin/json2catalog.py sample/ > sample.db 2>/dev/null
$ time bin/json2catalog.pl sample/ > sample.db 2>/dev/null
When I started learning Python, and specifically learning Python’s Natural Language Toolkit (NLTK), I thought this slowness was do to the large NLTK library, but now I’m not so sure. It is just me, or is Python really s l o o o w ? Is there anything I can do to improve/optimize my Python code?
Eric Lease Morgan