4 ms·
I remember another article, but cannot find it. It had very different arguments what is slow about Python and would have disagreed with those two articles. Pyt
by qznc 10y ago
I remember another article, but cannot find it. It had very different arguments what is slow about Python and would have disagreed with those two articles.
Python is slow because it is dynamically typed rather than statically typed? No. In most cases, type inference is good enough. See Javascript. Python is slow because it is interpreted rather than compiled? That is not really a limit in the long run. Insert a JIT compiler. Java was interpreted as well initially.
Python's object model can lead to inefficient memory access? No we are getting somewhere. Scripting languages in general tend to overuse hashmaps. That gives you a lot of flexibility and monkey patching. It is also a lot harder to optimize than dynamic dispatch.
Another problem of scripting languages is the inability to control your memory. Python forces you to make a lot of memory allocations and there is little control over the garbage collector. Even Java suffers from this, but the JVM engineers invested a lot to fix it. There are no value record types (struct) in Java.
- telotortium 10y agoWhy Python, Ruby, and Javascript Are Slow: https://news.ycombinator.com/item?id=5304873 https://news.ycombinator.com/item?id=5304873
- qznc 10y agoThat might be it. I remember it as an article. Maybe http://lukauskas.co.uk/articles/2014/02/13/why-your-python-runs-slow-part-1-data-structures/ http://lukauskas.co.uk/articles/2014/02/13/why-your-python-r...
- foota 10y agoPython's fairly unique OO reflection like abilities make it fairly hard to do things other than with pointers for any sort of object interaction imo.