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 20699D100 for ; Thu, 13 Sep 2012 13:34:15 +0000 (UTC) Received: (qmail 79580 invoked by uid 500); 13 Sep 2012 13:34:14 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 79377 invoked by uid 500); 13 Sep 2012 13:34:13 -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 79012 invoked by uid 99); 13 Sep 2012 13:34:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 13:34:11 +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; Thu, 13 Sep 2012 13:34:09 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id CA944A08B; Thu, 13 Sep 2012 13:33:48 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: [Bug 53867] New: Performance tuning solution for PageContextImpl.XmlEscape Date: Thu, 13 Sep 2012 13:33:48 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 7 X-Bugzilla-Component: Jasper X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: xshao@ebay.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: priority bug_id assigned_to short_desc bug_severity classification reporter rep_platform bug_status version component product Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=53867 Priority: P2 Bug ID: 53867 Assignee: dev@tomcat.apache.org Summary: Performance tuning solution for PageContextImpl.XmlEscape Severity: enhancement Classification: Unclassified Reporter: xshao@ebay.com Hardware: PC Status: NEW Version: trunk Component: Jasper Product: Tomcat 7 Created attachment 29369 --> https://issues.apache.org/bugzilla/attachment.cgi?id=29369&action=edit Patch for PageContextImpl.java XmlEscape is used to do escape special characters for EL result. Currently it gets characters from String one by one and check whether the char is special character or not, than put the char into a StringBuilder. Most cases the string has no such special characters, However, it always creates a new StringBuilder than do such iteration. It's better to check whether there is any special characters first. If there is special character, then do create a StringBuilder and put those characters in front of te special character into the StringBuilder. Again, check the string by character one by one similar as the original logic. Here is the result of comparison testing between the two methods. Old escape:1610 New escape:1050 Old escape:1566 New escape:873 Old escape:1437 New escape:905 Old escape:1590 New escape:890 Old escape:1452 New escape:889 Old escape:1547 New escape:889 Old escape:1467 New escape:889 Old escape:1575 New escape:930 Old escape:1479 New escape:874 Old escape:1517 New escape:970 -- 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