[Twisted-web] load balancing and performance

Andrea Arcangeli andrea at cpushare.com
Sun Jan 30 05:31:58 MST 2005

On Sun, Jan 30, 2005 at 11:18:52PM +1100, Andrew Bennetts wrote:
> zope.interface already has an (optional) C module with optimisations in it.

Yet another reason for definitely switching to zope.interfaces.

Still I'd like an evaluation of the computational complexity of
zope.interfaces to be sure the C implementation isn't a workaround.
I'm not going to use interfaces in my code at all, unless somebody
confirms interfaces run always in O(1) like if we could do ctx.request
instead of IRequest(ctx). ctx.request is definitely O(1), and
IRequest(ctx) must be avalable in O(1) too, otherwise it's a mistake to
use interfaces at all. ctx.request is blazing fast, and IRequest(ctx)
must not be slower than ctx.request.

And I'm glad with basic twisted there are no interfaces at all. Like
going from protocol to factory has to be done with protocol.factory, not
IFactory(protocol). I really prefer to stay with pointers and not with
the interfaces as long as I can in my code, unless somebody guarantees
that zope.interfaces is O(1). (my http server is an exception, I use
interfaces there since I was partly forced by inevow)

More information about the Twisted-web mailing list