Re: [Zope-dev] logrotation/logreopening in ZTK-based applications

2010-11-11 Thread Christian Theune
On 11/12/2010 06:22 AM, Fred Drake wrote:
> On Wed, Nov 10, 2010 at 8:23 AM, I said:
>> There's a package called zc.signalhandler in the Zope Corporation
>> repository that I'll be open-sourcing.
>
> This is now available on svn.zope.org.  The tests pass with Python
> 2.4, 2.5, 2.6, and 2.7.
>
> I've added a brief README.txt to show how it's used; there's a more
> extensive doctest inside the package.

Cool, thanks!


-- 
Christian Theune · c...@gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] logrotation/logreopening in ZTK-based applications

2010-11-11 Thread Fred Drake
On Wed, Nov 10, 2010 at 8:23 AM, I said:
> There's a package called zc.signalhandler in the Zope Corporation
> repository that I'll be open-sourcing.

This is now available on svn.zope.org.  The tests pass with Python
2.4, 2.5, 2.6, and 2.7.

I've added a brief README.txt to show how it's used; there's a more
extensive doctest inside the package.


  -Fred

--
Fred L. Drake, Jr.    
"A storm broke loose in my mind."  --Albert Einstein
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Zope Tests: 83 OK, 11 Failed

2010-11-11 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Wed Nov 10 13:00:00 2010 UTC to Thu Nov 11 13:00:00 2010 UTC.
There were 94 messages: 6 from Zope Tests, 4 from buildbot at pov.lt, 19 from 
buildbot at winbot.zope.org, 11 from ccomb at free.fr, 54 from jdriessen at 
thehealthagency.com.


Test failures
-

Subject: FAILED : Zope Buildbot / zope2.13-py2.7 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:18:13 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023570.html

Subject: FAILED : Zope Buildbot / zope2.14-py2.7 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:21:53 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023573.html

Subject: FAILED : Zope Buildbot / zopetoolkit-1.0_win-py2.4 slave-win
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:24:50 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023575.html

Subject: FAILED : Zope Buildbot / zopetoolkit-1.0_win-py2.5 slave-win
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:25:19 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023576.html

Subject: FAILED : Zope Buildbot / zope2.13-py2.7 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:31:59 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023580.html

Subject: FAILED : Zope Buildbot / zope2.14-py2.7 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:35:43 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023583.html

Subject: FAILED : Zope Buildbot / zopetoolkit-py2.7 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:51:25 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023591.html

Subject: FAILED : Zope Buildbot / zopetoolkit-py2.7 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 13:09:02 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023602.html

Subject: FAILED : winbot / ztk_dev py_270_win32
From: buildbot at winbot.zope.org
Date: Wed Nov 10 15:38:10 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023612.html

Subject: FAILED : Zope Buildbot / zopetoolkit-py2.7 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 15:47:09 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023613.html

Subject: FAILED : Zope Buildbot / zopetoolkit-py2.7 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 15:48:43 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023615.html


Tests passed OK
---

Subject: OK : Zope Buildbot / zope2.12-py2.6 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:14:29 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023568.html

Subject: OK : Zope Buildbot / zope2.13-py2.6 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:16:19 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023569.html

Subject: OK : Zope Buildbot / zope2.14-py2.6 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:20:06 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023571.html

Subject: OK : Zope Buildbot / zope2.13_win-py2.6 slave-win
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:21:30 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023572.html

Subject: OK : Zope Buildbot / zope2.13_win-py2.7 slave-win
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:24:06 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023574.html

Subject: OK : Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:27:28 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023577.html

Subject: OK : Zope Buildbot / zope2.12-py2.6 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:27:50 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023578.html

Subject: OK : Zope Buildbot / zope2.13-py2.6 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:29:43 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023579.html

Subject: OK : Zope Buildbot / zopetoolkit-1.0-py2.5 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:33:16 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023581.html

Subject: OK : Zope Buildbot / zope2.14-py2.6 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:33:48 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023582.html

Subject: OK : Zope Buildbot / zopetoolkit-1.0_win-py2.6 slave-win
From: jdriessen at thehealthagency.com
Date: Wed Nov 10 12:37:02 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-November/023584.html

Sub

Re: [Zope-dev] zope.interface memory optimization

2010-11-11 Thread Brian Sutherland
On Wed, Nov 10, 2010 at 12:07:00PM +0100, Charlie Clark wrote:
> Am 10.11.2010, 01:40 Uhr, schrieb Brian Sutherland  
> :
> 
> >> > On the micro benchmarks, the only difference I see is a memory
> >> > improvement which I think will not survive in practice because most
> >>
> >> ... ?
> > Er, somehow my thoughts didn't make it into text:
> > attributes are zope.schema fields (i.e. subclasses of Attribute).
> > To really make that work, you'd have to add __slots__ to most of the
> > classes in zope.schema as well.
> 
> It might be purely academic but if this does significantly reduce memory  
> use then it might be worth pursuing.

Turns out it's not that academic. I tried a bit harder and managed to
apply __slots__ to the Element, Attribute and Method classes in
zope.interface. That saved an additional 0.5 % of memory (bytes).

I have a small patch to zope.schema that fixes the breakage there.

It looks like there is an additional 0.5% available if zope.schema is
refactored to use slots as well.

> Slots are supposed to be beneficial  
> when you've got lots of objects around. Zope schema fields are pretty  
> static anyway so I don't see a great penalty in having to add slots to  
> them, although obviously a migration of a larger project would probably be  
> a pain.

Searching for __dict__ here:


http://zope3.pov.lt/trac/browser/zope.schema/trunk/src/zope/schema/_bootstrapfields.py

Will give you a good idea of the problems. Field.bind and
ValidatedProperty both depend heavily on __dict__.

For ValidatedProperty in particular I have no idea how that would work
when using slots.

> Back to the micro-optimisation. At Jeff Rush's talk at PyCon this year he  
> covered the penalties incurred by "." lookups so that might be something  
> that could be investigated but might it also be possible to "memoize" the  
> method calls? I keep forgetting when you can't do that.

I had a look at http://en.wikipedia.org/wiki/Memoization, but I don't
see how it could be applied in this case.

> Charlie
> -- 
> Charlie Clark
> Managing Director
> Clark Consulting & Research
> German Office
> Helmholtzstr. 20
> Düsseldorf
> D- 40215
> Tel: +49-211-600-3657
> Mobile: +49-178-782-6226
> ___
> Zope-Dev maillist  -  Zope-Dev@zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )

-- 
Brian Sutherland
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] SVN: zope.interface/branches/jinty-mem/src/zope/interface/interface.py Improve CPU performance of previous memory optimization

2010-11-11 Thread Brian Sutherland
On Tue, Nov 09, 2010 at 03:01:09PM -0500, Tres Seaver wrote:
> > I think the is a possible threading issue with Element.setTaggedValue
> > and Specification.subscribe - if two threads called the method
> > concurrently, then one of the values might be lost. I think the
> > correct way to do it would be:
> > 
> > tv = self.__tagged_values
> > if tv is None:
> > tv = self.__dict__.setdefault('_Element__tagged_values', {})
> > tv[tag] = value
> > 
> > This does bring the name mangling back though.

Thanks, I fixed the threading issue in Specification.subscribe. Given
that that part of subscribe is not run very often, I think we can live
with limited name mangling.

> I'm pretty sure we can safely neglect threading issues here:  no sane
> code will call 'setTaggedValue' except at import time, when we should be
> serialized by Python's own import lock.

Great, I quoted you on that ;)

The setdefault fix for the threading issue is not compatible with the
use of __slots__. I couldn't find another way to do it.

-- 
Brian Sutherland
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )