#25 Logging has negative influence on performance

open
nobody
None
5
2012-10-26
2009-11-27
No

I've made some profiling on my application which uses smpp in multithreading mode. I saw that 30% of the send(Request request, boolean asynchronous) method from org.smpp.Session is spent on request.debugString() method. See the code below:

///////////////////////////
final private Response send(Request request, boolean asynchronous)
throws ValueNotSetException, TimeoutException, PDUException, IOException {
debug.enter(DSESS, this, "send(Request)");
Response response = null;

    debug.write(DSESS, "Sending request " + request.debugString());

.....

/////

I think first we should check the debug level and then call debug.write(DSESS, "Sending request " + request.debugString());.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks