Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #89620
| Path | csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'heavily': 0.04; 'run-time': 0.05; 'startup': 0.05; 'subject:Python': 0.06; 'great.': 0.07; 'intermediate': 0.07; 'python3': 0.07; 'sys': 0.07; 'bash': 0.09; 'doing?': 0.09; 'git': 0.09; 'imported': 0.09; 'latter': 0.09; 'lookup': 0.09; 'main()': 0.09; 'runtime': 0.09; 'sure,': 0.09; 'url:github': 0.09; '\xe2\x80\x94': 0.09; 'cc:addr:python-list': 0.11; 'contribute': 0.11; 'python': 0.11; 'language,': 0.12; 'systems.': 0.12; "';'": 0.16; 'bash,': 0.16; 'command.': 0.16; 'conversions,': 0.16; 'does,': 0.16; 'dotted': 0.16; 'dwarfed': 0.16; 'finds': 0.16; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'invoked,': 0.16; 'libraries.': 0.16; 'lookups': 0.16; 'materially': 0.16; 'mercurial,': 0.16; 'notation': 0.16; 'python;': 0.16; 'rather,': 0.16; 'rewritten': 0.16; 'seconds.': 0.16; 'tends': 0.16; 'worse.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'figures': 0.19; 'producing': 0.19; "python's": 0.19; 'thu,': 0.19; 'work,': 0.20; 'written': 0.21; 'code,': 0.22; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'parse': 0.24; 'java': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'script': 0.25; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; '[1]': 0.29; "doesn't": 0.30; '[2]': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'requests': 0.31; 'usually': 0.31; 'bunch': 0.31; 'fast.': 0.31; 'languages:': 0.31; 'file': 0.32; 'languages': 0.32; 'another': 0.32; 'up.': 0.33; 'third': 0.33; 'table': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'disk': 0.36; 'machine.': 0.36; 'done': 0.36; 'doing': 0.36; 'useful': 0.36; 'thanks': 0.36; 'so,': 0.37; 'operating': 0.37; 'level': 0.37; 'performance': 0.37; 'being': 0.38; 'ben': 0.38; 'files': 0.38; 'pm,': 0.38; 'itself': 0.39; 'either': 0.39; 'most': 0.60; 'hardware': 0.61; 'effective': 0.61; 'entire': 0.61; 'skip:* 10': 0.61; 'times': 0.62; 'making': 0.63; 'show': 0.63; 'high': 0.63; 'real': 0.63; 'soon': 0.63; 'more': 0.64; 'different': 0.65; 'great': 0.65; '30,': 0.65; 'situation': 0.65; 'life': 0.66; 'close': 0.67; 'real-world': 0.68; 'internet': 0.71; 'clubs': 0.74; 'connection.': 0.74; 'cut': 0.74; 'increase': 0.74; '2015': 0.84; 'golf': 0.84; 'notably,': 0.84; 'pike': 0.84; 'superb': 0.91; 'to:none': 0.92; 'numerous': 0.93; 'serious': 0.97 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=Ft3ioP2DSd4wcZ+smMIgivbZn1Jcyl5o/WtyQ5nVWsA=; b=O3nsdqAti+IdoBN7Ay4xNh2zbfnEp4trNBQNpnpIdwAJB8NXC2Ut9A9EyI3i5fHKgg FMwVONKvX1RFQ/yh5EkL+SKy1eGjmTw1GRjooQNYp2nwOVY4HXiWMiJoHObjkCZtK1nr APT12XpBqlhFF/G2f0LlpGp44fIxBiUn8CxnJwEfYp1q25TQJDLbvnT3nAPr9rgsaTKZ LbIogIRIk5Ph6zc9H/Gi29RYrOjgk7JQ9hSBH6gvjdv37PxTp0EpRwyILdhCkjvu7YSc eBwOrLr/b+qqK0lmc5BDgnmFUyJ/5vYUUYrwmqJly3jIaePpzWk0K71HaMbS+ZdARHLj 277w== |
| MIME-Version | 1.0 |
| X-Received | by 10.107.16.32 with SMTP id y32mr4562976ioi.53.1430391123427; Thu, 30 Apr 2015 03:52:03 -0700 (PDT) |
| In-Reply-To | <87383hj4zj.fsf@elektro.pacujo.net> |
| References | <87mw1q9jqw.fsf@Equus.decebal.nl> <mailman.121.1430385051.3680.python-list@python.org> <87383hj4zj.fsf@elektro.pacujo.net> |
| Date | Thu, 30 Apr 2015 20:52:03 +1000 |
| Subject | Re: Python is not bad ;-) |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.124.1430391126.3680.python-list@python.org> (permalink) |
| Lines | 88 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1430391126 news.xs4all.nl 2894 [2001:888:2000:d::a6]:57170 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:89620 |
Show key headers only | View raw
On Thu, Apr 30, 2015 at 8:16 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Ben Finney <ben+python@benfinney.id.au>:
>
>> The latter is not a property of Python; a programming language doesn't
>> have runtime performance. Rather, runtime performance is a property of
>> some specific *implementation* — that is, the runtime Python machine.
>>
>> There are numerous Python runtimes, and they have different
>> performance characteristics on different hardware and operating
>> systems.
>
> Still, Python has features that defy effective optimization. Most
> notably, Python's dot notation translates into a hash table lookup -- or
> worse.
>
> I currently carry three clubs in my professional golf bag: bash, python
> and C. Java is a great programming language, but Python and C manage
> everything Java would be useful for.
(I carry a lot more clubs in my bag. The Ace of Clubs for me is Pike,
but Python comes in a close second; both are decently high
performance, quick to write code in, and come with extensive standard
libraries. Any bash script that grows to more than a page or so of
code usually finds itself rewritten in Python or Pike; C is mainly for
writing high level programming languages in.)
Most of the programs that I write spend their time on work far more
serious than looking up names in dictionaries. For instance, one of my
programs [1] shells out to avconv and sox to do a bunch of big file
conversions, doing its best to fill up my hard disk (eighty-odd gig of
intermediate files is a good start), and ultimately producing one
hefty video file. Another that I contribute heavily to [2] uses lame
to manipulate a bunch of .MP3 files and, ultimately, stream them down
an internet connection. A third [3] sleeps its entire life away,
either making network requests and waiting for the responses, or
outright sleep()ing until it needs to go do something again. If the
cost of run-time lookups of dotted names were to increase by an order
of magnitude, not one of them would materially change in performance.
Sure, you can do microbenchmarks that show that Python takes X times
longer to parse "x.y.z" than Java does, but if that's seriously
impacting your real-world code, what are you doing?
About the only time when Python performance makes a real difference is
on startup. Mercurial, for instance, has to be invoked, initialized,
and shut down, for every command. (That's why git tends to outdo it in
a lot of ways, thanks to being written mainly in C and Perl.) So yes,
there are efforts every now and then to cut the startup time, where
however-many modules all have to get imported and set up. In the most
micro of microbenchmarks, here's what it takes to do nothing in
several languages:
rosuav@sikorsky:~$ cat repeat.sh
for i in {1..100}; do $@; done
rosuav@sikorsky:~$ time bash repeat.sh pike -e ';'
real 0m8.504s
user 0m7.928s
sys 0m0.436s
rosuav@sikorsky:~$ time bash repeat.sh python3 -c pass
real 0m3.094s
user 0m2.400s
sys 0m0.424s
rosuav@sikorsky:~$ time bash repeat.sh python2 -c pass
real 0m1.843s
user 0m1.136s
sys 0m0.488s
rosuav@sikorsky:~$ echo 'int main() {return 0;}' |gcc -x c -
rosuav@sikorsky:~$ time bash repeat.sh ./a.out
real 0m0.076s
user 0m0.004s
sys 0m0.012s
So, yeah. Pike's a poor choice and C's superb if you want to start up
and shut down real fast. Great. But as soon as those figures get
dwarfed by real work, nothing else matters. It's a rare situation
where you really need to start a program in less than 0.085 seconds.
ChrisA
[1] https://github.com/Rosuav/FrozenOST
[2] https://github.com/MikeiLL/appension
[3] https://github.com/Rosuav/LetMeKnow
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 09:07 +0200
Re: Python is not bad ;-) Ben Finney <ben+python@benfinney.id.au> - 2015-04-30 19:10 +1000
Re: Python is not bad ;-) Marko Rauhamaa <marko@pacujo.net> - 2015-04-30 13:16 +0300
Re: Python is not bad ;-) Chris Angelico <rosuav@gmail.com> - 2015-04-30 20:52 +1000
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 13:30 +0200
Re: Python is not bad ;-) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-01 17:03 +1000
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-05-01 09:47 +0200
Re: Python is not bad ;-) Christian Gollwitzer <auriocus@gmx.de> - 2015-05-01 19:56 +0200
Re: Python is not bad ;-) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-05-02 19:44 +1200
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-05-02 10:26 +0200
Re: Python is not bad ;-) Marko Rauhamaa <marko@pacujo.net> - 2015-05-02 12:10 +0300
Re: Python is not bad ;-) Chris Angelico <rosuav@gmail.com> - 2015-05-02 19:25 +1000
Re: Python is not bad ;-) Marko Rauhamaa <marko@pacujo.net> - 2015-05-02 12:58 +0300
Re: Python is not bad ;-) Dave Angel <davea@davea.name> - 2015-05-02 06:22 -0400
Re: Python is not bad ;-) Chris Angelico <rosuav@gmail.com> - 2015-05-02 20:42 +1000
Re: Python is not bad ;-) Christian Gollwitzer <auriocus@gmx.de> - 2015-05-02 13:07 +0200
Re: Python is not bad ;-) Chris Angelico <rosuav@gmail.com> - 2015-05-02 21:21 +1000
Re: Python is not bad ;-) Christian Gollwitzer <auriocus@gmx.de> - 2015-05-02 13:32 +0200
Re: Python is not bad ;-) Marko Rauhamaa <marko@pacujo.net> - 2015-05-02 14:42 +0300
Re: Python is not bad ;-) Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-02 09:45 -0600
Re: Python is not bad ;-) Chris Angelico <rosuav@gmail.com> - 2015-05-03 01:55 +1000
Re: Python is not bad ;-) Joonas Liik <liik.joonas@gmail.com> - 2015-05-02 16:50 +0300
Re: Python is not bad ;-) Joonas Liik <liik.joonas@gmail.com> - 2015-05-02 18:53 +0300
Re: Python is not bad ;-) Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-02 11:00 -0600
Re: Python is not bad ;-) Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-02 11:17 -0600
Re: Python is not bad ;-) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-02 18:22 +0100
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-05-02 12:29 +0200
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-05-02 11:33 +0200
Re: Python is not bad ;-) Dave Angel <davea@davea.name> - 2015-05-02 06:35 -0400
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-05-02 13:12 +0200
Re: Python is not bad ;-) Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-02 09:31 -0600
Re: Python is not bad ;-) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-01 15:56 +1000
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 13:10 +0200
Re: Python is not bad ;-) Michael Torrie <torriem@gmail.com> - 2015-04-30 08:03 -0600
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 18:11 +0200
Re: Python is not bad ;-) Christian Gollwitzer <auriocus@gmx.de> - 2015-04-30 19:59 +0200
Re: Python is not bad ;-) Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 22:05 +0200
csiph-web