Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 97371 invoked from network); 7 Aug 2006 17:31:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Aug 2006 17:31:56 -0000 Received: (qmail 34726 invoked by uid 500); 7 Aug 2006 17:31:43 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 34706 invoked by uid 500); 7 Aug 2006 17:31:43 -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 34695 invoked by uid 99); 7 Aug 2006 17:31:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2006 10:31:43 -0700 X-ASF-Spam-Status: No, hits=3.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 204.17.65.6 is neither permitted nor denied by domain of dckerber@verizon.net) Received: from [204.17.65.6] (HELO mr02.conversent.net) (204.17.65.6) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2006 10:31:42 -0700 Received: from [127.0.0.1] (host254.111.41.216.conversent.net [216.41.111.254]) (authenticated bits=0) by mr02.conversent.net (8.13.4/8.13.4) with ESMTP id k77HVLkc002188 for ; Mon, 7 Aug 2006 13:31:21 -0400 (EDT) Message-ID: <44D778E3.2080204@verizon.net> Date: Mon, 07 Aug 2006 13:31:15 -0400 From: David Kerber User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Code performance question #2 References: <44D7729B.6000100@pidster.com> In-Reply-To: <44D7729B.6000100@pidster.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Pid wrote: >here's another obvious question: > >if you're in a servlet, and you're getting an & separated string from >somewhere, where is the "somewhere" that you're getting it from? > >does the servlet activate and collection the data somehow, or does the >data get sent to the servlet (in, for example the query string)? > > The data is sent via an HTTP POST request, with the query string lightly encrypted. > > > > >Peter Crowther wrote: > > >>>From: David Kerber [mailto:dckerber@verizon.net] >>>Is there a more efficient "split" method I could use? Or am I >>>completely missing the point of what you are suggesting? >>> >>> >>I think you've slightly missed the point. I assume you're calling your function 5 times, each with a different field name that you want out of it. You're then invoking string handling functions on the entire decrypted string 5 times, each time going through the bytes to extract the piece you need. In the process, you traverse bytes you don't need several times. My suggestion is that you tokenise this *once*, and hence only pay the string-handling overhead once. Then you get all the parameters out of the same tokenised version. >> >>However, if the next thing you do is to write this to disk, I am even more convinced that you're optimising the wrong piece of code as the disk I/O is likely to take vastly more instructions than the string parse. >> >>These may be na�ve questions, but I'll ask them anyway. How have you identified these two pieces of code as the targets for optimisation? What profiler have you used, under what conditions? What proportion of your overall CPU budget is taken by these two snippets of code? Is the machine CPU-bound in the first place, or is the bottleneck elsewhere? If these are the worst culprits in your app, I'll be very surprised. >> >> - Peter >> >> --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org