On Nov 18, 2011, at 4:34 PM, Ludovic Dubost wrote:
While I understand that for developers load time is
important, at this
point 15 seconds (+ the xwiki init time which would be nice to measure),
yes that's the second part. I've started but not finished the analysis.
does not seem that much.
It's mostly because we're evaluating the idea of running functional tests per
extension.
It's important to note that this is not time that
has to be spent again
before there is another restart of the JVM which should not even happen. We
have plenty of servers which run full time.
It would be more important to improve speed for a page once the app is
loaded
Of course. And we've been knowing what to improve for a long time already… It's
just not that simple to do and we need to spend some quality time for doing that.
Performance was once put on the roadmap but has been removed ever since so nobody has had
the time to spend good quality time on improving performance for a long time now.
Personally I think it's important and I'd love to see that back on the roadmap.
Thanks
-Vincent
Ludovic
2011/11/18 Vincent Massol <vincent(a)massol.net>
> Hi devs,
>
> I've been finding that Jetty takes a lot of time to start lately. So I've
> run some profiling on it.
>
> Starting Jetty (till the STARTING message) takes 15 seconds on my machine
> (in debug mode, we win 3 seconds, ie 12s start time), split like this:
>
> * 50% of the time spent scanning jars in WEB-INF/lib
> (JarInputStream.getNextJar()) - 7s
> * 10% in Jetty itself - 2s
> * 40% in our code in Extension Manager init (2.5s) and in Component
> registration from their annotations (2.5s) - 5s
>
> If I remove the start of the EM in XWikiServletContextListener, we start
> in 7 seconds (instead of 15s)
>
> If I try to start Jetty without any webapp, it starts in 500ms.
>
> If I remove the oldcore legacy jar (2.5MB) we win 1 second in start up
> time.
>
> Note: This is all before XWiki.init() is called on the first request.
>
> Analysis of ComponentAnnotationLoader (2.5s):
> * 1.2s just loading classes from the CL
> * 1s getDeclaredFields (reflection API)
> * 800ms initializing SLF4J
>
> Analysis of Extension Manager init (2.5s):
> * In DefaultCoreExtensionScanner.loadExtensions():
> ** 500ms URL.toURI()
> ** 500ms MavenXpp3Reader.read() - POM reading
> ** 150ms org.Reflections scanning
> ** 150ms resource loading from CL (getResourceAsStream())
> * In DefaultExtensionLicenseManager.initialize()
> ** 314ms in org.Reflections
> * 130ms of loading xwiki.properties
>
> Conclusion
> =========
>
> * XWiki's size in number of JARs and their sizes makes it long to start
> Jetty.
> * We could make some small optimizations in EM and Component loading but
> we wouldn't win that much, on the order of 2s in total (i.e. 15% of total
> load time)
>
> Thanks
> -Vincent