[Soot-list] debug statements impact performance
Attila Bartha
at.bartha at gmail.com
Tue Oct 20 20:12:51 EDT 2009
Hi
I just bumped into an example of a typical performance killer:
In class soot.dava.DavaBody:
DavaBody(Body body) {
this(body.getMethod());
debug("DavaBody","creating DavaBody
for"+body.getMethod().toString());
Dava.v().log("\nstart method " + body.getMethod().toString());
The invocations of debug() and log() are unconditional. The accumulated
computation time for calculating the arguments can be significant. The
condition within the debug() method does not solve this problem. It could be
a quite a performance improvement to do a cleanup by adding conditions like
if (DEBUG) debug(.)
Cheers
Attila
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20091021/946d9d04/attachment.html
More information about the Soot-list
mailing list