On Tue, May 25, 2004 at 03:39:31PM +0200, Rostislav Svoboda wrote:
: I'd like to ask you if there's a significant difference in performance 
: between:
: 
:    String ret = "";
:    for (count = 0; rs.next(); count++)
:        ret += rs.getString("column_name");         // result of db query
:    out.print(ret);
:    
: and:
: 
:    for (count = 0; rs.next(); count++)
:        out.print(rs.getString("column_name");      // result of db query
: 
: I know I have the extra string which is (theoretically) a slow-down but I 
: don't
: know anything about the way how tomcat handles with large strings (in my 
: case about 1MB), if is there any limited buffering etc. 

1/ what happens when you load-test the two variations?

2/ it's not about Tomcat handling strings; it's how the underlying JVM
   handles strings.

3/ what happens when you load-test the two variations?

4/ depends on the JDK; newer compilers /may/ see a repeat string concat
   ("+" op) and replace w/ StringBuffer under the covers...

5/ what happens when you load-test the two variations?

But, as always, see #1 for the end-all, be-all answer.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to