Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2010-12-31 Thread Maciej Fijalkowski
> OK, but is it mandatory? For example, in the above code, I can unroll the
> loop because I found that range is the usual built-in, 5 is a low-enough
> constant,

How do you know xrange is xrange and not something else?

Cheers,
fijal
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2010-12-31 Thread Maciej Fijalkowski
On Fri, Dec 31, 2010 at 12:00 PM, Maciej Fijalkowski  wrote:
>> OK, but is it mandatory? For example, in the above code, I can unroll the
>> loop because I found that range is the usual built-in, 5 is a low-enough
>> constant,
>
> How do you know xrange is xrange and not something else?
>
> Cheers,
> fijal
>

Err, misread. How do you know that range is a builtin you're thinking
about and not some other object?

Cheers,
fijal
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2010-12-31 Thread Cesare Di Mauro
2010/12/31 Maciej Fijalkowski 

> On Fri, Dec 31, 2010 at 12:00 PM, Maciej Fijalkowski 
> wrote:
> >> OK, but is it mandatory? For example, in the above code, I can unroll
> the
> >> loop because I found that range is the usual built-in, 5 is a low-enough
> >> constant,
> >
> > How do you know xrange is xrange and not something else?
> >
> > Cheers,
> > fijal
> >
>
> Err, misread. How do you know that range is a builtin you're thinking
> about and not some other object?
>
> Cheers,
> fijal
>

By a special opcode which could do this work. ]:-)

Cesare
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2010-12-31 Thread Ethan Furman

Cesare Di Mauro wrote:
>

2010/12/29 "Martin v. Löwis" wrote:

>>

Am 28.12.2010 18:08, schrieb Lukas Lueg:

Also, the load_fast in lne 22 to reference x could be taken out of the

>>> loop as x will always point to the same object


 That's not true; a debugger may change the value of x.


Another example. I can totally remove the variable i, just using the 
stack, so a debugger (or, in general, having the tracing enabled) cannot 
even find something to change about it.


-1

Debugging is challenging enough as it is -- why would you want to make 
it even more difficult?


~Ethan~
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2010-12-31 Thread skip

>> Another example. I can totally remove the variable i, just using the
>> stack, so a debugger (or, in general, having the tracing enabled)
>> cannot even find something to change about it.

Ethan> -1

Ethan> Debugging is challenging enough as it is -- why would you want to
Ethan> make it even more difficult?


I don't know.  Maybe he wants his program to run faster.


If you use print statements for the bulk of your debugging (many people do),
unrolling loops doesn't affect your debugging ability.

Skip
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Summary of Python tracker Issues

2010-12-31 Thread Python tracker

ACTIVITY SUMMARY (2010-12-24 - 2010-12-31)
Python tracker at http://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.

Issues counts and deltas:
  open2525 (-17)
  closed 20058 (+49)
  total  22583 (+32)

Open issues with patches: 1063 


Issues opened (19)
==

#10764: sysconfig and alternative implementations
http://bugs.python.org/issue10764  reopened by michael.foord

#10771: descriptor protocol documentation has two different definition
http://bugs.python.org/issue10771  opened by Devin Jeanpierre

#10772: Several actions for argparse arguments missing from docs
http://bugs.python.org/issue10772  opened by ipatrol

#10775: assertRaises as a context manager should accept a 'msg' keywor
http://bugs.python.org/issue10775  opened by r.david.murray

#10782: Not possible to cross-compile due to poor detection of %lld su
http://bugs.python.org/issue10782  opened by bgamari

#10784: os.getpriority() and os.setpriority()
http://bugs.python.org/issue10784  opened by giampaolo.rodola

#10785: parser: store the filename as an unicode object
http://bugs.python.org/issue10785  opened by haypo

#10786: unittest.TextTextRunner does not respect redirected stderr
http://bugs.python.org/issue10786  opened by cooyeah

#10787: [random.gammavariate] Add the expression of the distribution i
http://bugs.python.org/issue10787  opened by David.Kremer

#10788: test_logging failure
http://bugs.python.org/issue10788  opened by pitrou

#10789: Lock.acquire documentation is misleading
http://bugs.python.org/issue10789  opened by Jyrki.Pulliainen

#10790: Header.append's charset logic is bogus, 'shift_jis' and "euc_j
http://bugs.python.org/issue10790  opened by r.david.murray

#10791: Wrapping TextIOWrapper around gzip files
http://bugs.python.org/issue10791  opened by dabeaz

#10794: Infinite recursion while garbage collecting loops indefinitely
http://bugs.python.org/issue10794  opened by Mihai.Rusu

#10796: readline completion flaw
http://bugs.python.org/issue10796  opened by rheise

#10798: test_concurrent_futures fails on FreeBSD
http://bugs.python.org/issue10798  opened by loewis

#10799: Improve webbrowser.open doc (and, someday, behavior?)
http://bugs.python.org/issue10799  opened by terry.reedy

#10800: libffi build failure on HP-UX 11/PA
http://bugs.python.org/issue10800  opened by 
bugs-pyt...@vendor.thewrittenword.com

#10801: zipfile.ZipFile().extractall() header mismatch for non-ASCII c
http://bugs.python.org/issue10801  opened by M..Z.



Most recent 15 issues with no replies (15)
==

#10800: libffi build failure on HP-UX 11/PA
http://bugs.python.org/issue10800

#10799: Improve webbrowser.open doc (and, someday, behavior?)
http://bugs.python.org/issue10799

#10798: test_concurrent_futures fails on FreeBSD
http://bugs.python.org/issue10798

#10796: readline completion flaw
http://bugs.python.org/issue10796

#10789: Lock.acquire documentation is misleading
http://bugs.python.org/issue10789

#10787: [random.gammavariate] Add the expression of the distribution i
http://bugs.python.org/issue10787

#10775: assertRaises as a context manager should accept a 'msg' keywor
http://bugs.python.org/issue10775

#10772: Several actions for argparse arguments missing from docs
http://bugs.python.org/issue10772

#10761: tarfile.extractall fails to overwrite symlinks
http://bugs.python.org/issue10761

#10760: tarfile doesn't handle sysfs well
http://bugs.python.org/issue10760

#10752: build_ssl.py is relying on unreliable behaviour of os.popen
http://bugs.python.org/issue10752

#10751: WSGIREF - REMOTE_USER and REMOTE-USER collision
http://bugs.python.org/issue10751

#10747: Include version info in Windows shortcuts
http://bugs.python.org/issue10747

#10746: ctypes c_long & c_bool have incorrect PEP-3118 type codes
http://bugs.python.org/issue10746

#10745: setup.py install --user option undocumented
http://bugs.python.org/issue10745



Most recent 15 issues waiting for review (15)
=

#10801: zipfile.ZipFile().extractall() header mismatch for non-ASCII c
http://bugs.python.org/issue10801

#10798: test_concurrent_futures fails on FreeBSD
http://bugs.python.org/issue10798

#10790: Header.append's charset logic is bogus, 'shift_jis' and "euc_j
http://bugs.python.org/issue10790

#10787: [random.gammavariate] Add the expression of the distribution i
http://bugs.python.org/issue10787

#10786: unittest.TextTextRunner does not respect redirected stderr
http://bugs.python.org/issue10786

#10785: parser: store the filename as an unicode object
http://bugs.python.org/issue10785

#10784: os.getpriority() and os.setpriority()
http://bugs.python.org/issue10784

#10766: optparse uses %s in gettext calls
http://bugs.python.org/issue10766

#10765: Build regression from automation changes on windows
http://bugs.python.org/issue10765

#10756: Error in atexit._run_exitfuncs [...]  

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2010-12-31 Thread Cesare Di Mauro
2010/12/31 Ethan Furman 

> Cesare Di Mauro wrote:
>
> >
>
>> 2010/12/29 "Martin v. Löwis" wrote:
>>
> >>
>
>> Am 28.12.2010 18:08, schrieb Lukas Lueg:
>>>
 Also, the load_fast in lne 22 to reference x could be taken out of the

>>> >>> loop as x will always point to the same object
>
>>
>>>  That's not true; a debugger may change the value of x.
>>>
>>
>> Another example. I can totally remove the variable i, just using the
>> stack, so a debugger (or, in general, having the tracing enabled) cannot
>> even find something to change about it.
>>
>
> -1
>
> Debugging is challenging enough as it is -- why would you want to make it
> even more difficult?
>
> ~Ethan~


With a good test suite you can forget debuggers.

In more than 6 years of Python programming, I have used it only two times
(to debug an ANTLR generated parser).

Cesare
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2010-12-31 Thread Cesare Di Mauro
2010/12/31  

>
>>> Another example. I can totally remove the variable i, just using the
>>> stack, so a debugger (or, in general, having the tracing enabled)
>  >> cannot even find something to change about it.
>
   Ethan> -1
>
>Ethan> Debugging is challenging enough as it is -- why would you want to
>Ethan> make it even more difficult?
>
> 
> I don't know.  Maybe he wants his program to run faster.
>  
>

:D

"Aggressive" optimizations can be enabled with explicit options, in order to
leave normal "debugger-prone" code.


> If you use print statements for the bulk of your debugging (many people
> do),
> unrolling loops doesn't affect your debugging ability.
>
>  Skip


It's a common practice. Also IDEs helps a lot, and advanced interactive
shells too (such as DreamPie).

Cesare
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com