On Fri, 2009-04-03 at 19:30 +0800, Mingfai wrote: Hi Mingfai,
since you are starting to get a usual poster here :) please to not top-post in the future. Why? http://www.caliburn.nl/topposting.html http://en.wikipedia.org/wiki/Posting_style "A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?" > well.. to backup my claim that creating instance has no difference in > performance, i did a profiling+benchmark base on the test case that i > have attached to the JIRA issue. I am not going in depth here but the problem with this test is that they do not include GC. GC is taking up resources to be performed. If you create lots of instances the GC will have to kick in earlier then later (and more often) each time it will produce a performance leak while doing the GC. Further in many classes creating an instance is related to do the heavy stuff only once. In our case there is no heavy lifting involved. Your test are: 1) new LinkResolver(base, "/index.html").resolve().toString(); 2) LinkResolver.staticResolve(base, null).toString(); I thought of: LinkResolver resolver = new LinkResolver (base); resolver.resolve(linkPart); resolver.resolve(linkPart2); .... Thanks for your feedback and your contributions let us now see how to best incorporate them in droids. salu2 -- Thorsten Scherler <thorsten.at.apache.org> Open Source <consulting, training and solutions>
