tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: authorization providers (was More on JAAS)
Date Wed, 19 Apr 2000 17:46:55 GMT
Costin Manolache wrote:

> > I know about Perl (that's the day job ;) and Apache. There's also a
> > simplistic Perl api for Netscape and I think you can do something
> > in IIS, but the point is that even with Perl, the underlying
> > architecture is still primarily derived because the server itself is in C.
> I'm curious - where do you think is the impact of C in this architecture?
> My impresion is that what matter most is the alghoritm - not the
> language you use to express it.

It matters because design patterns copied from C sometimes have performance
impacts when you transliterate them to Java.

Consider the current RequestInterceptor interface, with roughly 10 "handler"
methods.  In C, it is pretty low overhead to maintain a dispatch table of
pointers to functions, and just call the ones that are non-NULL (i.e. the ones
that the module has registered itself as interested in).  In Java, all 10 of
those calls happen on *every* interceptor (assuming they flow on through, which
is the usual case), on *every* request.  Most of them just use the empty
impelmentation in the default base class -- they are relatively cheap, but they
are definitely NOT free.

In comparison, the Catalina architecture for Valves requires one method call per
interceptor -- to the invoke() method -- no matter how complex its internel
logic is.  There are other differences that I want to address in the context of
a response to one of Gal's questions; this will be in a separate message.

View raw message