Python is horribly slow compared to bash!!

W

wxjmfauth

Le jeudi 22 mai 2014 12:54:22 UTC+2, Chris Angelico a écrit :
Figure some of you folks might enjoy this. Look how horrible Python

performance is!



http://thedailywtf.com/Articles/Best-of-Email-Brains,-Security,-Robots,-and-a-Risky-Click.aspx



Actually, probably a lot of you folks already read TDWTF, but maybe

some don't (yet).



ChrisA
=========
=========
timeit.repeat("(x*1000 + y)[:-1]", setup="x = 'abc'; y = 'z'") [1.4027834829454946, 1.38714224331963, 1.3822586635296261]
timeit.repeat("(x*1000 + y)[:-1]", setup="x = 'abc'; y = '\u0fce'")
[5.462776291480395, 5.4479432055423445, 5.447874284053398]

Na, na, na, I win.

But that's peanuts.

I can make an application running 100 times slower just
by replacing 'z' with Dutch characters. [*]. I win again.

I can take the same application and replace 'z' by ..., and
.... No, I do not win :-( . Python fails.


[*] Unicode is fascinating, working with it is a little
bit travelling.

jmf
 
M

Mark H Harris

Figure some of you folks might enjoy this. Look how horrible Python
performance is!

http://thedailywtf.com/Articles/Best-of-Email-Brains,-Security,-Robots,-and-a-Risky-Click.aspx
From TDWTF:
Most of the interesting physics analysis code here is based
on a framework using Python scripts for setup and configuration
which then calls native analysis code, that usually is implemented in C++.

This goes back to a previous discussion about about Julia (couple weeks
back) and IPython. What these guys at CERN need is the dynamic duo of
IPython and Julia. (its gonna be fabulous, seriously)

Or, Julia by itself. The whole point of the Julia project was to bring
the whole dynamic scripting, glue, lightning fast FORTRAN or C++
specialty code, into one screaming fast package that "does it all".

Of course that's a pipe dream, but they are getting very close. And, if
they pull off the IPython | Julia match-up thing, man, its going to
change the way technical computation is handled for decades to come.

Back to the TDWTF post, what a hoot. Ok, you heard it there first
people, Python is dead everyone learn BASH. :p heh

marcus
 
J

Johannes Bauer

I can take the same application and replace 'z' by ..., and
... No, I do not win :-( . Python fails.

That's nothing. I can make an application a TOUSAND times slower by
changing the constant 1 to a 2. Python is such utter garbage!

import time

def myfunction(constant):
if constant == 1:
time.sleep(1)
else:
time.sleep(1000)

constant = 1
myfunction(constant)

Now let's all code Itanium assembler, yes?

Cheers,
Johannes

--
Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über Rüdiger Thomas in dsa <[email protected]>
 
G

Grant Edwards

Naw... Let's beg Intel to bring back the iAPX-432, and beg AdaCore to
port GNAT to it.

When the '432 datasheets came out, everybody thought it was pretty
cool. Turns out it just didn't "go". So, Intel lowered its sights
and concentrated on the 8086 family, and we all suffered for the next
few decades as a result...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top