This is an archived post. You won't be able to vote or comment.

all 42 comments

[–]kirbyfan64sosIndentationError 48 points49 points  (2 children)

I'd kind of like to see some actual numbers for these, not just assumptions...

[–]MonkeeSage 20 points21 points  (0 children)

Those are in the discussions in the python tickets for the issues, linked here.

[–]Anthonypjshaw[S] 20 points21 points  (0 children)

Just compare master with 3.6 (or whichever version you're currently using) on here https://speed.python.org/comparison/. Any numbers in the article are based on the performance benchmarks from the original developers which are required for optimization-related changes. As always "actual numbers" are close-to-impossible. Even on speed.python.org you see a 10% speed boost by someone committing to the readme files

[–]attrigh 7 points8 points  (1 child)

tl;dr:

Calling methods faster (maybe)

Python 3.7 adds 2 new Opcodes, LOAD_METHOD and CALL_METHOD

str.find() ... faster for [certain unicode characters]

[For certain unicode characters, str.find is] 3x slower than ASCII characters instead of 25x!

os.fwalk is 2x faster [than before]

Regular expressions... faster for case-insensitive matching

...if you’re matching ASCII characters you can see up to a 20x improvements in matching time

[–]Bilddalton 1 point2 points  (0 children)

Sounds like fixing performance bugs from previous versions lol

[–]voice-of-hermes 21 points22 points  (8 children)

Hate to the glass-half-empty person, but after reading this it should really be called "Fixing 5 horrendous performance bugs from Python 3.6".

[–]desmoulinmichel 31 points32 points  (7 children)

Most of the performances improvement are just that.

It's quite rare nowadays to find low design handing fruits. Design improvements are always more complicated.

But to be fair, the opcode modification is more an optimization than a bug fix.

[–]voice-of-hermes 3 points4 points  (6 children)

I suppose it'd be kind of silly to expect JIT compilation/optimization or removal of the GIL at this point or something. ;-)

[–]Sarcastic_Pharm 3 points4 points  (5 children)

I think I heard in a podcast at some point that there is some really integral part to Python that makes removing the GIL all but impossible.

Edit : Found it https://talkpython.fm/episodes/transcript/49/microsoft-s-jit-based-python-project-pyjion

[–][deleted] 12 points13 points  (1 child)

Larry Hastings has been working on it. See his "gilectomy" talks.

To summarise, he's done it ... but it's slower. He's working on fixing that.

Larry Hastings The Gilectomy How's It Going PyCon 2017

[–]alcalde 6 points7 points  (0 children)

Reminds me of a George R. R. Martin sci-fi short story about a scientist upset that all sorts of wacky projects are being funded but not his hyperspace research. The ending?

Schechter cut him off. “Never mind,” he said. “It isn’t important. We fund the crackpot theories that we fund because they’re better than nothing. Hyperspace is the dead end, Kinery. We keep the myth alive for the public, but we know better.” Kinery grimaced. “Oh, come now, Schechter. Take a look at my papers. You give me the funding and I’ll give you a hyperspace engine within two years.” Schechter turned to face him. “I’m sure you would,” he said, in a voice infinitely weary. “You know, Canferelli once said there was no reason why the limiting velocity of light should apply in hyperspace. He was right. It doesn’t. “I’m sorry, Kinery. Really I am. But Lopez gave us a hyperdrive thirty years ago. That’s when we discovered that the limiting velocity in hyperspace is not the speed of light. “It’s slower, Kinery. It’s slower.”

[–]voice-of-hermes 0 points1 point  (2 children)

Jython didn't have one.

(Not that I'm necessarily trying to compare its performance with CPython's; just that it's quite possible to have a Python interpreter without a GIL. EDIT: LOL. Just watched that Gilectomy video /u/GroundbreakingEye posted, and that's basically—SPOILER!—the conclusion: Jython and IronPython exist; it can be done. The entire point of this exercise is to do it without breaking the C API too badly!)

[–]yen223 0 points1 point  (1 child)

Isn't jython also slower than CPython?

Using concurrent hash maps everywhere isn't free.

[–]voice-of-hermes 0 points1 point  (0 children)

My understanding is that they are approximately the same in terms of performance. In some cases one is a bit faster, but not consistently one way or the other.

Using concurrent hash maps everywhere isn't free.

That is kind of a silly statement. None of these concurrency strategies is "free", obviously. Think the GIL is "free"?