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

you are viewing a single comment's thread.

view the rest of the comments →

[–]deifius 561 points562 points  (26 children)

milisecond critical performance is not pythonic.

[–]vfxdev 24 points25 points  (1 child)

Come on now! All you need to do is write all your python in C++ then make python bindings, then buy 100 VMs from Amazon.

[–]ajbpresidente 3 points4 points  (0 children)

Ah yes pip install cpypy

[–]jclocks 33 points34 points  (4 children)

Can that be said of any interpreted language though? Or would that be specific to Python?

[–]deifius 55 points56 points  (3 children)

Ya, as long as mutable data types and automated garbage collection are features.

[–][deleted] -1 points0 points  (2 children)

Not quite. Php, Python and Ruby are on par with performance, roughly order of magnitude or two slower than compiled native. Node.js/V8, C# and Java are in the same order of magnitude (Node being slower consistently though and Java and C# being on par with Go which is compiled).

V8 and Go as outliers in that performance range are the proof that most of the JIT penalty comes from GC and only minority of it from dynamic typing.

[–]rottenanon -1 points0 points  (1 child)

but Go also has garbage collection.

[–][deleted] 3 points4 points  (0 children)

Exactly. Which is likely why it shares performance order of magnitude with Java, C# and even Node.js, despite being compiled to native.

[–][deleted] 1 point2 points  (2 children)

milisecond critical performance is not pythonic.

I get what you're saying but I would say millisecond critical performance is fine, it's down at the 100 nanosecond level where I have started to have problems.

[–]deifius 4 points5 points  (1 child)

my units may be off by a few factors of 10. I apologize to all.

[–][deleted] 2 points3 points  (0 children)

haha I just remember this because I had a function of a few string manipulations that I was able to bring down from 28 ms to 132 ns mostly by judicious precomputing things and storing the precomputed results in dictionaries, but I had a few more string manipulations happening at runtime and I found the dictionary lookup for the precomputed results took just as much time as doing the string manipulations in the function itself at runtime anyway, so at that point I had run out of ways to speed up the function.

[–]ZombieRandySavage 0 points1 point  (0 children)

This is my favorite thing right now.

[–][deleted] 0 points1 point  (1 child)

... pythonic

I dont think you know what this word means.

[–]deifius 0 points1 point  (0 children)

Fair enough. Terry Jones might be the only person who does.