Guido van Rossum | 1 Dec 2007 01:21
Favicon

Re: [poll] New name for __builtins__

On Nov 30, 2007 3:59 PM, Greg Ewing <greg.ewing <at> canterbury.ac.nz> wrote:
> Terry Reedy wrote:
> > The only problem would be if someone put
> > the incantation into a non-main module named 'main.py', but the same is
> > true today of '__main__.py'.  And I would consider either a buggy practice.
>
> I often put the "real" main code into a separate module, so
> that it gets compiled to a .pyc, and sometimes I call that
> module "main.py". So this change would break a lot of my
> programs, and perhaps other people's as well.
>
> I think the situation with __main__ is different from __builtin__,
> because __builtin__ is an actual, specific module, whereas
> __main__ is a pseudo-module which stands in for a different thing
> in every Python program. So I'm in favour of keeping an
> __xxx__ name for it, to emphasise its magic nature. I'm much
> less likely to accidentally stomp on a magic name than a
> non-magic one.

Right. Rest assured, __main__ is not going to change.

--

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

(Continue reading)

Brett Cannon | 1 Dec 2007 04:16
Favicon
Gravatar

Re: -O2 faster than -O3?

On Nov 30, 2007 12:02 PM, Neil Toronto <ntoronto <at> cs.byu.edu> wrote:
> On both of my systems, using -O2 reduces execution time in pystone by 9%
> and in pybench by 8%. It's function inlining: "-O3
> -fno-inline-functions" works just as well as "-O2". Removing "-g" has
> little effect on the result.
>
> Systems:
>   - AMD Athlon 64 X2 Dual Core 4600+, 512 KB cache (desktop)
>   - Intel T2300 Dual Core 1.66GHz, 512 KB cache (laptop)
>
> Both are Ubuntu 7.04, GCC 4.1.2.
>
> Does anybody else see this?
>
> It may be GCC being stupid (which has happened before) or not enough
> cache on my systems (definitely possible). If it's not one of those, I'd
> say it's because CPython core functions are already very large, and
> almost everything that ought to be inlined is already a macro.
>

That's quite possible.  Previous benchmarks by AMK have shown that
perhaps -0m (or whatever the flag is to optimize for size) sometimes
is the best solution.  It has always been believed that the eval loop
is already large and manages to hit some cache sweet spot.

-Brett
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
(Continue reading)

Brett Cannon | 1 Dec 2007 04:18
Favicon
Gravatar

Re: [poll] New name for __builtins__

On Nov 30, 2007 3:16 PM, Fred Drake <fdrake <at> acm.org> wrote:
> On Nov 30, 2007, at 6:05 PM, Guido van Rossum wrote:
> > It's almost as if nobody has seen my proposal to leave __builtins__
> > alone and rename the __builtin__ module instead.
>
>
> I suspect that's indistinguishable from everyone being tired of the
> discussion, knowing that you're going to pick something reasonable in
> spite of our yammering.
>

Yeah.  I figured your rambling tolerance had already been hit on this
and you were just going to pick something.

> +1 for a module named "builtin", or something similarly obscure.

+1 for your (Guido's) 'builtins' suggestion so that there is symmetry
with __builtins__ and 'builtins'.

-Brett

>
>
>    -Fred
>
> --
> Fred Drake   <fdrake at acm.org>
>
>
>
(Continue reading)

Phillip J. Eby | 1 Dec 2007 02:16
Gravatar

Re: [poll] New name for __builtins__

At 06:16 PM 11/30/2007 -0500, Fred Drake wrote:
>On Nov 30, 2007, at 6:05 PM, Guido van Rossum wrote:
> > It's almost as if nobody has seen my proposal to leave __builtins__
> > alone and rename the __builtin__ module instead.
>
>
>I suspect that's indistinguishable from everyone being tired of the
>discussion, knowing that you're going to pick something reasonable in
>spite of our yammering.
>
>+1 for a module named "builtin", or something similarly obscure.

What he said - but "builtins", i.e. plural.

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Neal Norwitz | 1 Dec 2007 06:32
Picon

Re: -O2 faster than -O3?

On Nov 30, 2007 7:16 PM, Brett Cannon <brett <at> python.org> wrote:
> On Nov 30, 2007 12:02 PM, Neil Toronto <ntoronto <at> cs.byu.edu> wrote:
> > On both of my systems, using -O2 reduces execution time in pystone by 9%
> > and in pybench by 8%. It's function inlining: "-O3
> > -fno-inline-functions" works just as well as "-O2". Removing "-g" has
> > little effect on the result.
> >
> > Systems:
> >   - AMD Athlon 64 X2 Dual Core 4600+, 512 KB cache (desktop)
> >   - Intel T2300 Dual Core 1.66GHz, 512 KB cache (laptop)
> >
> > Both are Ubuntu 7.04, GCC 4.1.2.
> >
> > Does anybody else see this?
> >
> > It may be GCC being stupid (which has happened before) or not enough
> > cache on my systems (definitely possible). If it's not one of those, I'd
> > say it's because CPython core functions are already very large, and
> > almost everything that ought to be inlined is already a macro.
> >
>
> That's quite possible.  Previous benchmarks by AMK have shown that
> perhaps -0m (or whatever the flag is to optimize for size) sometimes
> is the best solution.  It has always been believed that the eval loop
> is already large and manages to hit some cache sweet spot.

The flag is -Os.  I suspect you will do better to limit the size of
inlining rather disabling it completely.  The option is
-finline-limit=number.  I don't know the default value or what you
should try.  I would be interested to hear more results though.
(Continue reading)

Terry Reedy | 1 Dec 2007 07:05
Picon
Favicon

Re: [poll] New name for __builtins__


"Greg Ewing" <greg.ewing <at> canterbury.ac.nz> wrote in message 
news:4750A3CC.2000207 <at> canterbury.ac.nz...
| I think the situation with __main__ is different from __builtin__,

I effectively agreed by not disputing Guido's response ;-) 

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Neil Toronto | 1 Dec 2007 07:35

Re: -O2 faster than -O3?

Neal Norwitz wrote:
> On Nov 30, 2007 7:16 PM, Brett Cannon <brett <at> python.org> wrote:
>> On Nov 30, 2007 12:02 PM, Neil Toronto <ntoronto <at> cs.byu.edu> wrote:
>>> On both of my systems, using -O2 reduces execution time in pystone by 9%
>>> and in pybench by 8%. It's function inlining: "-O3
>>> -fno-inline-functions" works just as well as "-O2". Removing "-g" has
>>> little effect on the result.
>>>
>>> Systems:
>>>   - AMD Athlon 64 X2 Dual Core 4600+, 512 KB cache (desktop)
>>>   - Intel T2300 Dual Core 1.66GHz, 512 KB cache (laptop)
>>>
>>> Both are Ubuntu 7.04, GCC 4.1.2.
>>>
>>> Does anybody else see this?
>>>
>>> It may be GCC being stupid (which has happened before) or not enough
>>> cache on my systems (definitely possible). If it's not one of those, I'd
>>> say it's because CPython core functions are already very large, and
>>> almost everything that ought to be inlined is already a macro.
>>>
>> That's quite possible.  Previous benchmarks by AMK have shown that
>> perhaps -0m (or whatever the flag is to optimize for size) sometimes
>> is the best solution.  It has always been believed that the eval loop
>> is already large and manages to hit some cache sweet spot.
> 
> The flag is -Os.  I suspect you will do better to limit the size of
> inlining rather disabling it completely.  The option is
> -finline-limit=number.  I don't know the default value or what you
> should try.  I would be interested to hear more results though.
(Continue reading)

Neil Toronto | 1 Dec 2007 07:39

Re: [poll] New name for __builtins__

Terry Reedy wrote:
> "Greg Ewing" <greg.ewing <at> canterbury.ac.nz> wrote in message 
> news:4750A3CC.2000207 <at> canterbury.ac.nz...
> | I think the situation with __main__ is different from __builtin__,
> 
> I effectively agreed by not disputing Guido's response ;-) 

Very cunning. But I was even more cunning, and didn't even *consider* 
disputing Guido's response.

Neil

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Steve Holden | 1 Dec 2007 07:50
Picon
Picon
Gravatar

Re: -O2 faster than -O3?

Neil Toronto wrote:
[...]
> If you're going to run these benchmarks yourself, make sure you "make 
> clean" before building with different options. (I don't know why it's 
> necessary, but it is.) 

Because the dependencies evaluated by "make" don't take into account the 
different options that were used to compile existing object files.

Without the "make clean" it says "aha, here's a nice up-to-date object 
file, I'll use that" and you don't get a freshly-compiled version.

Touching the sources should also work, and is a little quicker.

regards
  Steve
--

-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org

Steve Holden | 1 Dec 2007 07:51
Picon
Picon
Gravatar

[Fwd: Re: -O2 faster than -O3?]

[Sorry, the send key pressed itself there]

Touching the sources should also work, and is a little quicker (but this 
is usually only practical for small projects).

regards
  Steve
--

-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org


Gmane