Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E20E9D6F for ; Thu, 15 Mar 2012 18:29:49 +0000 (UTC) Received: (qmail 90691 invoked by uid 500); 15 Mar 2012 18:29:45 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 90585 invoked by uid 500); 15 Mar 2012 18:29:45 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 90572 invoked by uid 99); 15 Mar 2012 18:29:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 18:29:45 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED X-Spam-Check-By: apache.org Received-SPF: unknown ~allmx (nike.apache.org: encountered unrecognized mechanism during SPF processing of domain of nicholas.williams@puresafety.com) Received: from [74.125.149.205] (HELO na3sys009aog111.obsmtp.com) (74.125.149.205) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 15 Mar 2012 18:29:38 +0000 Received: from mail-vx0-f172.google.com ([209.85.220.172]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKT2I0/Aj8r9ovBQT7OgOmoLLUzUIrvLM4@postini.com; Thu, 15 Mar 2012 11:29:17 PDT Received: by mail-vx0-f172.google.com with SMTP id fk13so5991414vcb.17 for ; Thu, 15 Mar 2012 11:29:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:references:in-reply-to:mime-version:x-mailer:thread-index:date :message-id:subject:to:content-type:x-gm-message-state; bh=wOIxh/2X3VmJCaojiaY6nnJ+lItZ/Ql3aG3Dd+Hw0vY=; b=SJ0QqhdQwJH2HZcTP4y5nXvicv6ptAKc8M//R4fwdIrhEZl98857gK+esyFYYYjGJR 99Puq82bfYR2AvW7sazhuZ9A1G+6XRk0YjVmCQVvAE0K2npWRTVzWWyWrIBkScwkgke8 2pgciBWwr54Fvj2C8ScgnP44z16vTPYHOABKM9rg19T5bc4JIUH3YsEDfibD53xjzFz7 XthIQoKnYmsMilFvtqSa4hl3JVYlOPlbUAsRyu5sQt7hQmdU40DoKix/8H3tONlVOJik 1t2qv6cBNGm+x8rRCVmSfy90h/SFs1luHBt5xw2fvDyRKJFzXJIEH2pKFcDZjV3BX9RQ On8g== Received: by 10.52.240.144 with SMTP id wa16mr5307276vdc.94.1331836155817; Thu, 15 Mar 2012 11:29:15 -0700 (PDT) From: Nick Williams References: <4eda3d401cf06e1b22c0d27077b2d2c9@mail.gmail.com> <4F5EB56D.2000206@christopherschultz.net> <4F623182.9000900@christopherschultz.net> In-Reply-To: <4F623182.9000900@christopherschultz.net> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac0C14jNSeY9OISJREWIejIpMx3gewAAMr3Q Date: Thu, 15 Mar 2012 13:29:01 -0500 Message-ID: <47773497d8fd060ea33b816e7d3ee0d1@mail.gmail.com> Subject: RE: Precompile JSPs, avoid thousands of servlets? To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmrXOFxK+JxGW/wHGTcsGswR1rULNAb7lMbXWGvyIyymAvR36OakpIv/3A2sXdpiTtbnU1u X-Virus-Checked: Checked by ClamAV on apache.org > It seems reasonable that Jasper could be separated from the core of > Tomcat. We may consider attempting integrating Jasper into our product at a later date to see if that works. Not in this version of the product, however. > Are you simply trying to reduce the first-access time of each JSP? The performance improvement is always nice, but irrelevant. That can be achieved with startup compilation. The bigger issue is making sure that all of our JSPs compile. We can compile them at build time, but that only guarantees they'll compile for that particular version of that particular server. At one point, we had two JSPs that would compile in Tomcat 5.5.26-5.5.33 and Tomcat 6.0.20-6.0.32, but not Tomcat 5.5 < 5.5.26, not Tomcat 6 > 6.0.32, and not Tomcat 7. We have since fixed this issue and are trying to bring our JSPs to a more stable state. (We didn't build this product from the ground up, by the way, just in case you were wondering. We acquired it from a single developer who had written all 1.1 million lines of code by himself, never shared the details of the code with anyone else, never used any 3rd-party frameworks, never used any design patterns, and had ported (read: not re-written) the project from Pascal to C++/MFC to Java/Java EE over the course of 20 years.) N -----Original Message----- From: Christopher Schultz [mailto:chris@christopherschultz.net] Sent: Thursday, March 15, 2012 1:14 PM To: Tomcat Users List Subject: Re: Precompile JSPs, avoid thousands of servlets? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nick, On 3/15/12 1:21 PM, Nick Williams wrote: >> Hmm... do you have complete control over the version of Tomcat that >> your clients use? > > Unfortunately, we do not have complete control over this. This doesn't look good for you :( >> The JSP compiler uses Tomcat-specific classes and they are not part >> of any public API... > > Yea, I just looked at the sources for the compiled JSPs and see that > they're full of references to proprietary Tomcat classes. > Looks like this is the case no matter which App Server I compile the > JSPs with ... they end up full of classes from that App Server. > I guess that makes sense, what with Tag Pooling and everything else. Exactly: compiled JSPs are more than just raw scriptlets and tag-source placed into a .java file and compiled. Since the JSP API defines mostly interfaces and leaves it up to the containers to implement, this is necessarily the case. There isn't even a standard API for launching a JSP (other than calling "service"), though I'm sure everyone's implementation looks basically the same. The fact is that each JSP is going to need a bunch of support code that simply must come from the container. There is another possibility: tear-out Jasper from Tomcat and write your own JSPServlet that you map to *.jsp in your own webapp. It will probably be a bunch of work, and you'll either have to keep it in sync with the Tomcat sources or risk getting stale as bugs are fixed and improvements are made. The advantage, though, is that you could package it with your webapp and the it doesn't matter what container the client uses: the JSPs will run Jasper no matter what. I don't know how hard that would be -- I've never tried it :) It seems reasonable that Jasper could be separated from the core of Tomcat. I wonder if anyone else would be interested in such a clean separation. >> ...though switching content-generation frameworks isn't a task I >> would wish on a bitter enemy. > > Agreed. I wouldn't either. > > At this point, it looks like we're going to have to stick to shipping > the raw JSP files in the application and having them be compiled by > the container (either at startup or runtime ... one way or another). There are several ways to trigger compilation at start up (or immediately thereafter). Are you simply trying to reduce the first-access time of each JSP? Or is this a solution looking for a real-world problem? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9iMYIACgkQ9CaO5/Lv0PAXOwCeP9hcYtRyOjM2HvCy9KqetMOG NBcAoKCPHBlNwovMEOw/o4ejU/s+SpML =arEm -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org