tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Crowther" <>
Subject RE: Code performance question #2
Date Mon, 07 Aug 2006 16:08:49 GMT
> From: David Kerber [] 
> It is 
> executed for over 2 million data lines per day, so this routine is 
> executed over 10 million times per day.
[snippet of code that parses the line each time elided]

Opinion: You're optimising the wrong piece of code.

You're calling this 5 times in quick succession.  This means you're
parsing the same string the same way 5 times in quick succession.  Split
it on the &, put it into a suitably keyed structure such as a Map (or
even an array if you want the speed and know exactly what your
parameters are) and pass the keyed structure around.  That way you only
parse the string once.

		- Peter

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message