News for hackers. Stuff that matters.
Re:Why Python Is Slow: Looking Under the Hood by rurban on Tuesday November 18, 2014 @07:05PM (#8627268)
Unfortunately this blog post is misleading and uninformed. Python and the related other slow dynamic languages perl, php, and ruby are slow not because the dynamic type checks, branches and indirections are costly, but because they are badly written. They are just inefficient and poor interpreters, with bad ops and data structures. In comparison efficient dynamic languages like lisp, scheme, lua or javascript and many others not so well known do exist. Mine, potion, is also in the lua category, and not in the slow PPPR (python, perl, php, ruby) category.

The seminal paper about efficient dynamic interpreters is Ertl's "The Structure and Performance of Efficient Interpreters" http://www.complang.tuwien.ac.at/papers/ertl%26gregg03jilp.p...

The abstract is: "Interpreters designed for high general-purpose performance typically perform a large number of indirect branches (3.2%–13% of all executed instructions in our benchmarks). These branches consume more than half of the run-time in a number of configurations we simulated. We evaluate how accurate various existing and proposed branch prediction schemes are on a number of interpreters, how the mispredictions affect the performance of the interpreters and how two different interpreter implementation techniques perform with various branch predictors. We also suggest various ways in which hardware designers, C compiler writers, and interpreter writers can improve the performance of interpreters."

My own input to this is that the GC, the JIT, the calling convention and esp. the size of the datastructures and ops do matter more, than eliminating the type checks.

Re:Why Python Is Slow: Looking Under the Hood by lispm on Wednesday November 19, 2014 @03:01AM (#8628804)
I think the paper is even worse, in that it spreads confusion about what an Interpreter for a programming language actually is, what it does and what it provides.

The paper fails to define the concept of what to call an Interpreter. A bytecode interpreter is entirely different from a Lisp interpreter, which actually runs from source structures. Mixing VMs into the picture makes it only worse.

Part of the reason may be that they don't understand what an Interpreter actually provides and why it is used.

Re:Why Python Is Slow: Looking Under the Hood by pjmlp on Wednesday November 19, 2014 @01:51AM (#8628625)
It seems learning about compiler design is not as good as it used to be.

Better learn about the JavaScript framework of the day.

Re:Why Python Is Slow: Looking Under the Hood by enupten on Tuesday November 18, 2014 @07:12PM (#8627303)
The numerous Common Lisp implementations out there would agree with you.
Re:Why Python Is Slow: Looking Under the Hood by mamcx on Tuesday November 18, 2014 @07:27PM (#8627382)
Exist a sample I can follow that is made in a imperative language? I'm fluent in python, pascal, C#, obj-c but can survive C if the code is clear...