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


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

Nuitka now supports Python 3.2

Started bySteven D'Aprano <steve+comp.lang.python@pearwood.info>
First post2013-02-26 12:18 +0000
Last post2013-02-28 20:03 +0100
Articles 9 — 6 participants

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


Contents

  Nuitka now supports Python 3.2 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-26 12:18 +0000
    RE: Nuitka now supports Python 3.2 Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2013-02-26 16:49 +0300
    Re: Nuitka now supports Python 3.2 jmfauth <wxjmfauth@gmail.com> - 2013-02-27 00:21 -0800
      Re: Nuitka now supports Python 3.2 jmfauth <wxjmfauth@gmail.com> - 2013-02-27 00:44 -0800
      Re: Nuitka now supports Python 3.2 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-02-27 09:53 +0000
    Re: Nuitka now supports Python 3.2 Michael Torrie <torriem@gmail.com> - 2013-02-27 10:43 -0700
    Re: Nuitka now supports Python 3.2 Stefan Behnel <stefan_ml@behnel.de> - 2013-02-28 08:07 +0100
      Re: Nuitka now supports Python 3.2 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-28 13:23 +0000
        Re: Nuitka now supports Python 3.2 Stefan Behnel <stefan_ml@behnel.de> - 2013-02-28 20:03 +0100

#39944 — Nuitka now supports Python 3.2

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-02-26 12:18 +0000
SubjectNuitka now supports Python 3.2
Message-ID<512ca830$0$30001$c3e8da3$5496439d@news.astraweb.com>
Nuitka now supports Python 3.2 syntax and compiles the full CPython 3.2 
test suite.

http://nuitka.net/posts/nuitka-release-040.html


What is Nuitka?

Nuitka is an implementation of Python written in C++. At the moment it is 
claimed to be about 2.5 times as fast as CPython running the pystone 
benchmark. Future plans including using type inference and whole program 
analysis to optimize Python code using C++ native types.

Unlike PyPy, which is a JIT compiler, Nuitka is intended as a static 
optimizing compiler.


-- 
Steven

[toc] | [next] | [standalone]


#39948

FromAndriy Kornatskyy <andriy.kornatskyy@live.com>
Date2013-02-26 16:49 +0300
Message-ID<mailman.2543.1361886648.2939.python-list@python.org>
In reply to#39944
Steven,

Just in case... pypy1.9 runs this test 22x faster than cpython2.7, see below.

python2.7 -c "from test import pystone;[pystone.main() for i in range(10)]"
Pystone(1.1) time for 50000 passes = 0.62
This machine benchmarks at 80645.2 pystones/second
...
Pystone(1.1) time for 50000 passes = 0.53
This machine benchmarks at 94339.6 pystones/second


pypy-1.9/bin/pypy -c "from test import pystone;[pystone.main() for i in range(10)]"

Pystone(1.1) time for 50000 passes = 0.116008
This machine benchmarks at 431005 pystones/second
...
Pystone(1.1) time for 50000 passes = 0.024002
This machine benchmarks at 2.08316e+06 pystones/second

Thanks.

Andriy Kornatskyy


----------------------------------------
> From: steve+comp.lang.python@pearwood.info
> Subject: Nuitka now supports Python 3.2
> Date: Tue, 26 Feb 2013 12:18:56 +0000
> To: python-list@python.org
>
> Nuitka now supports Python 3.2 syntax and compiles the full CPython 3.2
> test suite.
>
> http://nuitka.net/posts/nuitka-release-040.html
>
>
> What is Nuitka?
>
> Nuitka is an implementation of Python written in C++. At the moment it is
> claimed to be about 2.5 times as fast as CPython running the pystone
> benchmark. Future plans including using type inference and whole program
> analysis to optimize Python code using C++ native types.
>
> Unlike PyPy, which is a JIT compiler, Nuitka is intended as a static
> optimizing compiler.
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list
 		 	   		  

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


#40035

Fromjmfauth <wxjmfauth@gmail.com>
Date2013-02-27 00:21 -0800
Message-ID<ad300016-0ee3-4020-b8fa-2a46571a2e8b@m4g2000vbo.googlegroups.com>
In reply to#39944
--------

Fascinating software.
Some are building, some are destroying.

Py33
>>> timeit.repeat("{1:'abc需'}")
[0.2573893570572636, 0.24261832285651508, 0.24259548003601594]

Py323
timeit.repeat("{1:'abc需'}")
[0.11000708521282831, 0.0994753634273593, 0.09901023634051853]

jmf

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


#40037

Fromjmfauth <wxjmfauth@gmail.com>
Date2013-02-27 00:44 -0800
Message-ID<4a5f5c10-ae3e-425a-bb2a-4abdef47ff41@j29g2000vby.googlegroups.com>
In reply to#40035
On 27 fév, 09:21, jmfauth <wxjmfa...@gmail.com> wrote:
> --------
>
> Fascinating software.
> Some are building, some are destroying.
>
> Py33>>> timeit.repeat("{1:'abc需'}")
>
> [0.2573893570572636, 0.24261832285651508, 0.24259548003601594]
>
> Py323
> timeit.repeat("{1:'abc需'}")
> [0.11000708521282831, 0.0994753634273593, 0.09901023634051853]
>
> jmf

----

Oops. My bad. (This google).

You should read abc需

jmf

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


#40043

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-02-27 09:53 +0000
Message-ID<mailman.2600.1361958809.2939.python-list@python.org>
In reply to#40035
On 27/02/2013 08:21, jmfauth wrote:
> --------
>
> Fascinating software.
> Some are building, some are destroying.
>
> Py33
>>>> timeit.repeat("{1:'abc需'}")
> [0.2573893570572636, 0.24261832285651508, 0.24259548003601594]
>
> Py323
> timeit.repeat("{1:'abc需'}")
> [0.11000708521282831, 0.0994753634273593, 0.09901023634051853]
>
> jmf
>

Haven't I seen you at the airport throwing bread crumbs to the 
helicoptors, as clearly that's just how stupid you are?

-- 
Cheers.

Mark Lawrence

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


#40070

FromMichael Torrie <torriem@gmail.com>
Date2013-02-27 10:43 -0700
Message-ID<mailman.2624.1361987024.2939.python-list@python.org>
In reply to#39944
On 02/26/2013 05:18 AM, Steven D'Aprano wrote:
> Nuitka now supports Python 3.2 syntax and compiles the full CPython 3.2 
> test suite.

Interestingly, GvR seemed to be quite critical of it in his comment at
the end of this post:
https://ep2013.europython.eu/conference/talks/nuitka-the-python-compiler

Not sure why.  Nuitka is a very interesting little project.  If nothing
else, it might be a good way of providing an executable bundle for a
python-based program, and a little speed-up is a bonus.

I find it pretty interesting that he can statically compile a dynamic
language.

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


#40119

FromStefan Behnel <stefan_ml@behnel.de>
Date2013-02-28 08:07 +0100
Message-ID<mailman.2642.1362035295.2939.python-list@python.org>
In reply to#39944
Steven D'Aprano, 26.02.2013 13:18:
> Nuitka is an implementation of Python written in C++. At the moment it is 
> claimed to be about 2.5 times as fast as CPython running the pystone 
> benchmark.

Could we please get to the habit of not citing results of "benchmarks" that
*any* static analysis phase will just optimise away either completely or in
major parts? It's not surprising that an empty loop runs faster than one
that actually does something. And most real-world code avoids empty loops
rather deliberately.

Stefan

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


#40129

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-02-28 13:23 +0000
Message-ID<512f5a6a$0$30001$c3e8da3$5496439d@news.astraweb.com>
In reply to#40119
On Thu, 28 Feb 2013 08:07:55 +0100, Stefan Behnel wrote:

> Steven D'Aprano, 26.02.2013 13:18:
>> Nuitka is an implementation of Python written in C++. At the moment it
>> is claimed to be about 2.5 times as fast as CPython running the pystone
>> benchmark.
> 
> Could we please get to the habit of not citing results of "benchmarks"
> that *any* static analysis phase will just optimise away either
> completely or in major parts?

Are you saying that the pystone benchmark contains such an empty loop?

Do you know for a fact that Nuitka performs such an optimization based on 
static analysis?

Are you saying that this one test is so significant that it invalidates 
the entire pystone benchmark?



-- 
Steven

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


#40153

FromStefan Behnel <stefan_ml@behnel.de>
Date2013-02-28 20:03 +0100
Message-ID<mailman.2664.1362078222.2939.python-list@python.org>
In reply to#40129
Steven D'Aprano, 28.02.2013 14:23:
> On Thu, 28 Feb 2013 08:07:55 +0100, Stefan Behnel wrote:
> 
>> Steven D'Aprano, 26.02.2013 13:18:
>>> Nuitka is an implementation of Python written in C++. At the moment it
>>> is claimed to be about 2.5 times as fast as CPython running the pystone
>>> benchmark.
>>
>> Could we please get to the habit of not citing results of "benchmarks"
>> that *any* static analysis phase will just optimise away either
>> completely or in major parts?
> 
> Are you saying that the pystone benchmark contains such an empty loop?
> 
> Do you know for a fact that Nuitka performs such an optimization based on 
> static analysis?
> 
> Are you saying that this one test is so significant that it invalidates 
> the entire pystone benchmark?

Yes, this effect renders most of the "benchmark" (and of similar
"benchmarks") useless, and yes, Nuitka obviously does static analysis (it's
a static compiler), just like the C++ compiler that passes over the
generated code right afterwards. It's nothing special. In fact, CPython is
special in that it (deliberately) does not apply this kind of
optimisations. Everyone else does, not so much because it's required but
because it's so simple to do when you need static analysis anyway in order
to do whatever kind of static code translation. And any static compiler
needs to do static analysis, at least to some extent.

The problem with this kind of "benchmarks" is that they were written for
CPython and are entirely based on the assumption that the runtime does not
apply any optimisations. As soon as this assumption fails, the "benchmarks"
are no longer meaningful. Specifically, they are completely useless for
comparing different runtimes.

In Cython, we even deliberately do *not* implement several possible
optimisations because we know that they would only apply to bad
"benchmarks", not to real-world code, and would thus only bloat our
compiler code more than they would help anyone. It's important to find a
good balance between complexity and performance, and I actually find that
CPython has made a very reasonable choice here. Its implementation is
intentionally simple in many aspects (especially its VM), and less so in
others (e.g. data types).

Stefan

[toc] | [prev] | [standalone]


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


csiph-web