Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] ClasspathPattern.match


Simone,

I've done some initial profiling using Recoc, a JVM profiling agent I'm working on featuring  a web UI backed by Jetty and Websockets :-)

Here's a live demo of Revoc instrumenting Jetty 8.1.8 on SVNSearch:

http://qa.svnsearch.org:7070/

Anyhow, according to Revoc, ClasspathPattern.match has been run 321213 times, taking a total of 321ms. This is on a CMS based webapp with a pretty fat collection of libraries. (2800 classes loaded in the VM)

WebAppClassLoader.loadClass takes a total of 7060ms, so it seems that class path pattern matching is taking 4.5% of the classloading time. Given that profiling itself might slow down classloading, the percentage is probably larger when profiling is disabled.

Next step I'll try to confirm these findings using another profiler. Then I'll try optimizing and see if there is a win.

I do realize we're talking about tiny improvements, but Jetty's super fast startup is an important contributor to making it an attractive platform. I'd like to contribute my milliseconds if I can :-)

Thanks,
Eirik.


On Mon, Nov 19, 2012 at 4:15 PM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
Hi,

On Thu, Nov 15, 2012 at 10:50 AM, Eirik Bjørsnøs <eirbjo@xxxxxxxxx> wrote:
>
> Hi,
>
> Should ClasspathPattern.match really be using regular expressions to tweak
> the name parameter before matching?
>
> On one of my apps, this method is called 23204 times at startup.

And how long does it take to start ?

> I haven't done any profiling, but I'm assuming on large classpaths, this
> must be an issue. (My assumption being that regexps are somewhat expensive)
>
> The methods using regexps (String.replaceFirst, String.replaceAll) both seem
> to be easily replaceable with a combination of String.contains and
> String.substring.
>
> wdyt?

That we need profiling data. If turns out to be a problem, we'll fix it.
If you want to profile and report to us, we'll be glad to fix it.

Simon
--
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
----
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top