The first one should be faster because in the second one there is a String object

created.  What be faster yet is if you could do something like this:

if(servlet.debug >= 1)
    servlet.log("debug/log message");

Then you wouldn't have that method call slowing you down.

Alan Yackel

Josh wrote:

> In the Struts example code wherever debug/log information is being printed to
> the log, the code appears:
>
> if (servlet.getDebug() >= 1)
>     servlet.log("debug/log message");
>
> I was wondering if that was advantageous over:
>
> servlet.log("debug/log message", 1);
>
> I am under the impression that the two samples work the same, and would prefer
> to use the second, however I was wondering if there was some sort of
> performance issue, etc . . .
>
> Thanks,
> Josh
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/

Reply via email to