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


Groups > comp.programming > #6269

Re: First Program with Python!

From BartC <bc@freeuk.com>
Newsgroups comp.programming
Subject Re: First Program with Python!
Date 2016-02-11 00:07 +0000
Organization A noiseless patient Spider
Message-ID <n9gj77$295$1@dont-email.me> (permalink)
References (2 earlier) <5ef3721a-7b0f-4dfd-8dbf-fac4a7172b94@googlegroups.com> <n9fg1k$jke$1@dont-email.me> <n9fki0$576$1@dont-email.me> <n9fps8$q5r$1@dont-email.me> <n9ggar$p6e$1@dont-email.me>

Show all headers | View raw


On 10/02/2016 23:18, David Brown wrote:
> On 10/02/16 17:55, BartC wrote:

>> I thought it was the former. But the end result is that the Python
>> program ends up faster (sometimes a magnitude or two faster), than
>> normal CPython. In which case, no will really care exactly how it works!
>
> For the most part, PyPy means people can write code that has the
> convenience and high-level features of Python, but when it comes to hard
> work code the result runs within spitting distance of a half-decent C
> program with a fraction of the effort.

I don't know about that, although some results are certainly very 
impressive. Here are the results of a test of a jpeg decoder, all 
versions running the same algorithm.

To decode a 2Mpix image to memory:

C:            <0.2 secs
M:             2 secs    (my competing bytecode interpreter)
PyPy:          3 secs
CPython 3.4:  22 secs

However, with an 80Mpix image with extra colour detail:

C:             11 secs
M:            300 secs
PyPy:         180 secs
CPython 3.4:  A long time ...

Here the loop optimiser of PyPy starts to kick in. (I'm currently 
looking at my interpreter to address the annoying problem of PyPy being 
somewhat faster.)

So for this application anyway, PyPy is a long way from C's speed. But 
even on other tests, I've seen little evidence of it being anywhere near 
C in performance terms.

-- 
Bartc

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

First Program with Python! anitagoyal571@gmail.com - 2016-02-09 06:11 -0800
  Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-09 14:30 +0000
    Re: First Program with Python! Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-02-09 14:35 +0000
      Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-09 19:06 +0000
        Re: First Program with Python! Öö Tiib <ootiib@hot.ee> - 2016-02-09 16:55 -0800
          Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-10 09:20 +0000
          Re: First Program with Python! Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-15 16:49 +0000
    Re: First Program with Python! Öö Tiib <ootiib@hot.ee> - 2016-02-09 16:32 -0800
      Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-10 14:07 +0000
        Re: First Program with Python! David Brown <david.brown@hesbynett.no> - 2016-02-10 16:24 +0100
          Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-10 16:55 +0000
            Re: First Program with Python! David Brown <david.brown@hesbynett.no> - 2016-02-11 00:18 +0100
              Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-11 00:07 +0000
          Re: First Program with Python! Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-15 16:58 +0000
        Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-10 21:51 +0000
          Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-11 00:15 +0000
  Re: First Program with Python! Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-15 16:46 +0000
    Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-15 17:31 +0000
      Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-15 20:16 +0000
        Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-15 22:45 +0000
          Re: First Program with Python! Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-16 03:40 +0000

csiph-web