Making CPython Faster
5 points by Spiritus 4 years ago | 2 comments- belharius 4 years ago[[In a “meta” issue in the GitHub tracker, Van Rossum outlined the three main pieces of the plan for 3.11. They all revolve around the idea of speeding up the bytecode interpreter through speculative specialization, which adapts the VM to run faster on some code because the object being operated on is of a known and expected type (or has some other attribute that can be determined with a simple test).]]
I thought adding type hints would improve the execution speed. If not now, at some point. Apparently they are not even considering it. They consider speculative specialization, which is likely more work than specialization based on known type hints. Still great to see that 'speed' is not ignored by the developers.
- treesciencebot 4 years agoThis has been brought up: https://github.com/python/cpython/pull/26264#discussion_r640...
Though personally I would dislike this, since every time somebody mentioned about type hints they commented on the property of them not causing 'ANY RUNTIME EFFECTS'. Of course the specializations come with guards, so if the annotation is wrong it is just going to work as a mispredicted option and fallback to the generic implementation though the concept of them changing the initial layer of optimizations is not something that I'd rather see in 'the Python language. PEP 563 even moves this properties forward and renders them totally uneffective in the eyes of the interpreter.
- treesciencebot 4 years ago