Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Nick Coghlan
On 7 Oct 2013 07:28, "Victor Stinner" wrote: > > 2013/10/6 : > > Quoting Antoine Pitrou : > > > >> The linecache module is used implicitly by the traceback and warnings > >> module, so perhaps quite a bit more than one would imagine :-) > >> > >> I think limiting the linecache cache size would be

Re: [Python-Dev] Make str/bytes hash algorithm pluggable?

2013-10-06 Thread Nick Coghlan
On 4 Oct 2013 07:17, "Guido van Rossum" wrote: > > On Thu, Oct 3, 2013 at 2:13 PM, Nick Coghlan wrote: >> >> On 4 Oct 2013 06:08, "Victor Stinner" wrote: >> > >> > 2013/10/3 Christian Heimes : >> > > A hash algorithm can be added and one avaible hash >> > > algorithm can be set before Py_Initial

Re: [Python-Dev] PEP 454: Add a new tracemalloc module (final version)

2013-10-06 Thread Victor Stinner
2013/10/3 Victor Stinner : > I worked on the implementation of the tracemalloc module and its PEP > 454. I consider that this third version of the PEP is ready for a > final review. > > HTML version of the PEP 454: > http://www.python.org/dev/peps/pep-0454/ About the implementation. I'm working i

Re: [Python-Dev] [Python-checkins] cpython (3.3): PythonCAD is now on PyQt, use Wing as a prominent PyGtk example.

2013-10-06 Thread Michael Foord
On 6 October 2013 11:45, georg.brandl wrote: > http://hg.python.org/cpython/rev/942b9420e7e9 > changeset: 86065:942b9420e7e9 > branch: 3.3 > parent: 86062:6ced4fb4f711 > user:Georg Brandl > date:Sun Oct 06 12:46:13 2013 +0200 > summary: > PythonCAD is now on PyQt, u

[Python-Dev] Fwd: Reduce memory footprint of Python

2013-10-06 Thread Olemis Lang
forwarding to the list , sorry ... -- Forwarded message -- From: Olemis Lang Date: Sun, 6 Oct 2013 17:09:38 -0500 Subject: Re: [Python-Dev] Reduce memory footprint of Python To: Benjamin Peterson On 10/6/13, Benjamin Peterson wrote: > 2013/10/6 Victor Stinner : >> 2013/10/6 Ben

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Olemis Lang
On 10/6/13, Benjamin Peterson wrote: > 2013/10/6 Victor Stinner : >> Hi, >> :) [...] >> >> unittest doesn't look to release memory (the TestCase class) after the >> execution of a test. > > Is it important to optimize unittests for memory usage? > AFAICT , test results will stored the outcomes

[Python-Dev] intobject.c free_list and int_dealloc()

2013-10-06 Thread Laurent Luce
Hello, I am trying to understand how the free list linked-list evolves when an int object is deallocated. At the beginning, free_list is pointing to the last int object (n-1) in the block.  We initialize two int objects, free_list now points to the int object: n-3. free_list -> n-3 n-1 -> n-2

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Victor Stinner
2013/10/6 : > Quoting Antoine Pitrou : > >> The linecache module is used implicitly by the traceback and warnings >> module, so perhaps quite a bit more than one would imagine :-) >> >> I think limiting the linecache cache size would be good enough. > > So what specific limit would you suggest? B

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Antoine Pitrou
On Sun, 06 Oct 2013 22:47:27 +0200 mar...@v.loewis.de wrote: > > Quoting Antoine Pitrou : > > > The linecache module is used implicitly by the traceback and warnings > > module, so perhaps quite a bit more than one would imagine :-) > > > > I think limiting the linecache cache size would be good

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread martin
Quoting Antoine Pitrou : The linecache module is used implicitly by the traceback and warnings module, so perhaps quite a bit more than one would imagine :-) I think limiting the linecache cache size would be good enough. So what specific limit would you suggest? Regards, Martin _

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread martin
Quoting Victor Stinner : Slowly, I'm trying to see if it would be possible to reduce the memory footprint of Python using the tracemalloc module. [...] Should I open a separated issue for each idea to track them in the bug tracker, or a global issue? There is a third alternative which I wou

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Antoine Pitrou
On Sun, 06 Oct 2013 22:27:52 +0200 mar...@v.loewis.de wrote: > > Quoting Benjamin Peterson : > > >> If you know that your application uses a lot of memory, it is > >> interesting to sometimes (when the application is idle) try to release > >> some bytes to not use all the system memory. On embedd

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread martin
Quoting Benjamin Peterson : If you know that your application uses a lot of memory, it is interesting to sometimes (when the application is idle) try to release some bytes to not use all the system memory. On embedded devices, memory is expensive and very limited. Each byte is important :-) H

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Victor Stinner
Benjamin wrote: > Is it important to optimize unittests for memory usage? 2013/10/6 Georg Brandl : > That does not seem very important, except if people execute test_import > on every interpreter startup :) Oh, I just realized that I forgot to explain why I'm starting with unit tests. I ran the P

Re: [Python-Dev] Optimization

2013-10-06 Thread Xavier Morel
On 2013-10-06, at 12:37 , Stephen J. Turnbull wrote: > > For me, the point about string "+=" being efficient (sometimes) isn't > that it is surprising compared to similar types, it's that it is > surprising for any immutable sequence type. It's clearly nitpicking, but ropes are immutable sequenc

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Stefan Behnel
Benjamin Peterson, 06.10.2013 17:41: > 2013/10/6 Victor Stinner: >> unittest doesn't look to release memory (the TestCase class) after the >> execution of a test. > > Is it important to optimize unittests for memory usage? Maybe "optimise" isn't the best word, but test suites can sometimes be hug

[Python-Dev] Wildcard mask and ANY IP

2013-10-06 Thread Stephen J. Turnbull
Amer writes: > Hello, > > I would like to thank you for your great effort > I have this question: > > I want to do the following IP address style in python > > ANY.45.10.ANY > ANY.x.y.z This list is for developing the Python language itself (including the CPython interpreter and the st

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Benjamin Peterson
2013/10/6 Victor Stinner : > 2013/10/6 Benjamin Peterson : >> 2013/10/6 Victor Stinner : >>> Hi, >>> >>> Slowly, I'm trying to see if it would be possible to reduce the memory >>> footprint of Python using the tracemalloc module. >>> >>> First, I noticed that linecache can allocate more than 2 MB.

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Victor Stinner
2013/10/6 Benjamin Peterson : > 2013/10/6 Victor Stinner : >> Hi, >> >> Slowly, I'm trying to see if it would be possible to reduce the memory >> footprint of Python using the tracemalloc module. >> >> First, I noticed that linecache can allocate more than 2 MB. What do >> you think of adding a reg

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Georg Brandl
Am 06.10.2013 17:32, schrieb Victor Stinner: > Hi, > > Slowly, I'm trying to see if it would be possible to reduce the memory > footprint of Python using the tracemalloc module. > > First, I noticed that linecache can allocate more than 2 MB. What do > you think of adding a registry of "clear cac

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Antoine Pitrou
Hi, On Sun, 6 Oct 2013 17:32:37 +0200 Victor Stinner wrote: > > Slowly, I'm trying to see if it would be possible to reduce the memory > footprint of Python using the tracemalloc module. > > First, I noticed that linecache can allocate more than 2 MB. What do > you think of adding a registry o

Re: [Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Benjamin Peterson
2013/10/6 Victor Stinner : > Hi, > > Slowly, I'm trying to see if it would be possible to reduce the memory > footprint of Python using the tracemalloc module. > > First, I noticed that linecache can allocate more than 2 MB. What do > you think of adding a registry of "clear cache" functions? For >

[Python-Dev] Reduce memory footprint of Python

2013-10-06 Thread Victor Stinner
Hi, Slowly, I'm trying to see if it would be possible to reduce the memory footprint of Python using the tracemalloc module. First, I noticed that linecache can allocate more than 2 MB. What do you think of adding a registry of "clear cache" functions? For exemple, re.purge() and linecache.clearc

[Python-Dev] Wildcard mask and ANY IP

2013-10-06 Thread Amer
Hello, I would like to thank you for your great effort I have this question: I want to do the following IP address style in python ANY.45.10.ANY ANY.x.y.z I tried something like: 10.45.10.1 0.255.255.0, but it is not accepted I got some errors Any help is appreciated Best regards, Amer ___

Re: [Python-Dev] Optimization

2013-10-06 Thread Stephen J. Turnbull
Nick Coghlan writes: > I suspect "list" may have been the intended comparison there. > "array.array" is another appropriate comparison. Having bytearray > operations differ in algorithmic complexity from those two types > would be very strange and surprising I don't see why. If you really w