Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4699B9E86 for ; Sun, 29 Jan 2012 17:36:28 +0000 (UTC) Received: (qmail 53132 invoked by uid 500); 29 Jan 2012 17:36:27 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 52903 invoked by uid 500); 29 Jan 2012 17:36:26 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 52894 invoked by uid 99); 29 Jan 2012 17:36:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Jan 2012 17:36:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Jan 2012 17:36:23 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id 08D504FF5B; Sun, 29 Jan 2012 17:36:03 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: DO NOT REPLY [Bug 52444] Classloading-based ServletContainerInitializer @HandlesTypes processing can result in long startup times Date: Sun, 29 Jan 2012 17:36:02 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 7 X-Bugzilla-Component: Catalina X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: markt@apache.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=52444 --- Comment #3 from Mark Thomas 2012-01-29 17:36:02 UTC --- Bringing across the list of suggestions from the duplicate... > a. if the class is an annotation, skip it Fixed in trunk and 7.0.x and will be included in 7.0.26 onwards. > b. if the class doesn't extend/implement any interface skip it Interesting. Thinking about this some more, the current isAssignableFrom() test is actually broader than it needs to be since it will return true for X.class.isAssignableFrom(X.class) and there is no need to add X to the initializerClassMap in this case. Apart from that however, isAssignableFrom() is the right test and that makes things a little more complicated to implement solely using byte code due to how the code currently iterates over the JARs (traversing the class hierarchy is the tricky part). Should be doable but likely to require a fair amount of re-factoring. > c. Look at the class hierarchy - this is actually quite easy (since > there's only one parent) and don't load it unless it implements > ServletContextListener This is not correct. HandlesType specify any class or interface. > d. if there are no Servlet initializers, don't load any classes The code already does this. > e. if the class needs to be loaded use a throwaway classloader If the class must be loaded to examine it yes, but hopefully it will be possible to avoid doing this. In summary, b) is the only remaining problem to solve. The solution looks like requiring caching all the javaClass instances and then doing the HandlesTypes processing (and then throwing away the cache). -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org