amir-jakoby / crawler-commons

Automatically exported from code.google.com/p/crawler-commons
0 stars 0 forks source link

[SiteMap] Unnecessary String concatenations when logging + in SiteMapURL.toString() #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Am seeing ~19% CPU time spent on string concatenations when parsing a large 
number of sitemap files. This is due to : 

* SiteMapURL.toString using implicit concatenations (String s = "url=\"" + url 
+ "\",") 

* SiteMapURL.toString being called unnecessarily e.g. LOG.debug("  " + (i + 1) 
+ ". " + sUrl);

The patch attached improved the toString() implementation and checks for the 
log levels before building the strings

Original issue reported on code.google.com by digitalpebble on 24 May 2013 at 2:07

GoogleCodeExporter commented 8 years ago
Committed revision 70.

Original comment by digitalpebble on 24 May 2013 at 2:10