Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71881 > unrolled thread

Python is horribly slow compared to bash!!

Started byChris Angelico <rosuav@gmail.com>
First post2014-05-22 20:54 +1000
Last post2014-05-22 14:17 -0500
Articles 7 — 6 participants

Back to article view | Back to comp.lang.python


Contents

  Python is horribly slow compared to bash!! Chris Angelico <rosuav@gmail.com> - 2014-05-22 20:54 +1000
    Re: Python is horribly slow compared to bash!! wxjmfauth@gmail.com - 2014-05-22 06:43 -0700
      Re: Python is horribly slow compared to bash!! Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-05-26 19:00 +0200
        Re: Python is horribly slow compared to bash!! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-05-26 19:19 -0400
          Re: Python is horribly slow compared to bash!! Grant Edwards <invalid@invalid.invalid> - 2014-05-27 14:12 +0000
            Re: Python is horribly slow compared to bash!! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-05-27 20:26 -0400
    Re: Python is horribly slow compared to bash!! Mark H Harris <harrismh777@gmail.com> - 2014-05-22 14:17 -0500

#71881 — Python is horribly slow compared to bash!!

FromChris Angelico <rosuav@gmail.com>
Date2014-05-22 20:54 +1000
SubjectPython is horribly slow compared to bash!!
Message-ID<mailman.10217.1400756071.18130.python-list@python.org>
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

[toc] | [next] | [standalone]


#71887

Fromwxjmfauth@gmail.com
Date2014-05-22 06:43 -0700
Message-ID<8848706d-405b-482e-8fba-4470e903ba02@googlegroups.com>
In reply to#71881
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

[toc] | [prev] | [next] | [standalone]


#72079

FromJohannes Bauer <dfnsonfsduifb@gmx.de>
Date2014-05-26 19:00 +0200
Message-ID<llvru7$a33$1@news.albasani.net>
In reply to#71887
On 22.05.2014 15:43, wxjmfauth@gmail.com wrote:

> 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

-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> 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 <hidbv3$om2$1@speranza.aioe.org>

[toc] | [prev] | [next] | [standalone]


#72092

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2014-05-26 19:19 -0400
Message-ID<mailman.10357.1401146392.18130.python-list@python.org>
In reply to#72079
On Mon, 26 May 2014 19:00:11 +0200, Johannes Bauer <dfnsonfsduifb@gmx.de>
declaimed the following:

>
>Now let's all code Itanium assembler, yes?
>
	Naw... Let's beg Intel to bring back the iAPX-432, and beg AdaCore to
port GNAT to it.

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#72117

FromGrant Edwards <invalid@invalid.invalid>
Date2014-05-27 14:12 +0000
Message-ID<lm26go$mfm$1@reader1.panix.com>
In reply to#72092
On 2014-05-26, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
> On Mon, 26 May 2014 19:00:11 +0200, Johannes Bauer <dfnsonfsduifb@gmx.de>
> declaimed the following:
>
>>
>>Now let's all code Itanium assembler, yes?
>
> 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...

-- 
Grant Edwards               grant.b.edwards        Yow! I smell like a wet
                                  at               reducing clinic on Columbus
                              gmail.com            Day!

[toc] | [prev] | [next] | [standalone]


#72137

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2014-05-27 20:26 -0400
Message-ID<mailman.10381.1401236827.18130.python-list@python.org>
In reply to#72117
On Tue, 27 May 2014 14:12:40 +0000 (UTC), Grant Edwards
<invalid@invalid.invalid> declaimed the following:

>On 2014-05-26, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>> On Mon, 26 May 2014 19:00:11 +0200, Johannes Bauer <dfnsonfsduifb@gmx.de>
>> declaimed the following:
>>
>>>
>>>Now let's all code Itanium assembler, yes?
>>
>> 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...

	Heh... I'm sure I have a hardcover of
http://www.amazon.com/Introduction-Intel-iAPX-432-Architecture/dp/0835932222
; wonder how much I could sell that for -- practically un-opened.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#71909

FromMark H Harris <harrismh777@gmail.com>
Date2014-05-22 14:17 -0500
Message-ID<lllifa$3ni$1@speranza.aioe.org>
In reply to#71881
On 5/22/14 5:54 AM, Chris Angelico wrote:
> 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web