Not creating a new HashMap all the time sounds like a good idea. I'd prefer to have it 
created lazily though so that it is not created when it is not needed (when you do not 
have any parameters for example).
Concerning the StringBuffer re-use: Did you measure the performance gain that you got 
from that? Since the buffer will be set to shared when the toString() method is called 
it means that the StringBuffer.delete method will need to copy the buffer, so there 
will be some overhead there anyway.

Best regards,

Dick Zetterberg
[EMAIL PROTECTED]

----- Original Message ----- 
From: "boxed" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 07, 2003 9:54 AM
Subject: [OS-webwork] URLBean performance issues


> I have a pretty large velocity page that needs to generate a lot of 
> urls, and I noticed that the roughly 4000 urls generated with the 
> URLBean class took about two seconds to generate. I took a look at the 
> code and saw that it creates and throws away a StringBuffer AND a 
> HashMap every single iteration. The URLTag class has the exact same 
> issue (since it's a copy paste instead of a reuse of the same code, 
> blech). I have attached the updated code, which is roughly twice as fast 
> on this perticular page at least.
> 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to