4 ms·
Python is also slow.
by easytiger 12y ago
Python is also slow.
- rdtsc 12y agoNo, pretty fast. Having used it for 10 years. Never had problems with its speed.
- tankenmate 12y agohttp://c2.com/cgi/wiki?PythonProblems http://c2.com/cgi/wiki?PythonProblems http://www.jeffknupp.com/blog/2012/03/31/pythons-hardest-problem/ http://www.jeffknupp.com/blog/2012/03/31/pythons-hardest-pro...
- lumpypua 12y agoNo seriously, also having used it for 10 years it's an issue for python. Three quick personal examples, though I've dealt with a number more: 1. Python web frameworks http://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=query http://www.techempower.com/benchmarks/#section=data-r9&hw=i7... Carefully configured Flask can get up to 1/3rd the speed of other web frameworks. But misconfigure it, use an ORM, or if you're on django, you're serving 1/10th as many requests/sec with significantly higher latency than other languages. 2. Templating https://stackoverflow.com/questions/1324238/what-is-the-fastest-template-system-for-python https://stackoverflow.com/questions/1324238/what-is-the-fast... Template rendering takes an appreciable amount of time. I had to replace django's (slow as shit) stock templates with jinja2 on a project because it was taking tens of seconds to render a very large page. Jinja is far faster, but it's still slow enough that I had to add a caching layer to a website that shouldn't need one. 3. Numerical shit I implemented a video processing algorithm from a paper for a computer vision class. Python's scientific and numeric libraries were sick and made prototyping delightfully easy--then the final runs on the full dataset took forever. What I re-implemented in C++ was >10x faster. Vectorization and other tweaks can make python numerics go faster, but it's a pain in the ass. One of the goals of the Julia scientific programming language is to make loops fast enough that code doesn't have to be manually vectorized.
- bpicolo 12y agoYeah, there are tradeoffs. SqlAlchemy is by far the most pleasant and thorough ORM to work with, for example. For any language. Full transactional support + every other feature you can dream of.
- easytiger 12y agoI work on bare bones low latency systems. Read from a socket->do some basic work->send on a socket. I prototype in python and use zeromq so i can simply insert a new piece of code in c++ when the time is right. Throughput generally increases 10x or more for the same algorithm
- easytiger 12y agoYou have never done anything requiring high throughput low latency computational pipelines clearly.
- rdtsc 12y agoSo, is that bad? Are my systems inferior because they are not "webscale" or "computational pipelines"? I never said I did that. Python is fast enough for what we do.