tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arvind Srinivasan <arvind.sriniva...@sun.com>
Subject Qn about a performance bottleneck in InvokerServlet
Date Mon, 10 Jun 2002 06:36:47 GMT
The following code snippet is from the serveRequest() method of
org.apache.catalina.servlets.InvokerServlet.java

-----
        String name = "org.apache.catalina.INVOKER." + servletClass;
        String pattern = inServletPath + "/" + servletClass + "/*";
        Wrapper wrapper = null;

        // Synchronize to avoid race conditions when multiple requests
        // try to initialize the same servlet at the same time
        synchronized (this) {

            // Are we referencing an existing servlet class or name?
            wrapper = (Wrapper) context.findChild(servletClass);
            if (wrapper == null)
                wrapper = (Wrapper) context.findChild(name);
            if (wrapper != null) {
                if (debug >= 1)
                    log("Using wrapper for servlet '" +
                        wrapper.getName() + "' with mapping '" +
                        pattern + "'");                
                context.addServletMapping(pattern, wrapper.getName());
             }

            // No, create a new wrapper for the specified servlet class
            else {
-----

What is the purpose of adding a servlet mapping of /servlet/$SERVLET/*
for servlets serviced by the invoker ?

context.addServletMapping is called on every request to the
InvokerServlet and shows up on performance profiles. Removing it did not
affect the behaviour of InvokerServlet but it eliminated this
performance hotspot.

Thanks,
 Arvind

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message