[prev in list] [next in list] [prev in thread] [next in thread] 

List:       htmlunit-user
Subject:    Re: [Htmlunit-user] Selenium/HtmlUnitDriver slow-down after
From:       Marc Guillemot <mguillemot () yahoo ! fr>
Date:       2011-09-23 6:33:26
Message-ID: 4E7C2836.8010306 () yahoo ! fr
[Download RAW message or body]

Hi Velte,

thanks for the feedback.

I'm very surprised from the slow down that you encounter. HtmlUnit-2.9
should in fact be faster than 2.8 due to different optimizations (as far
as I remember, it has been confirmed in the list by users). This is
particularly the case for HTMLCollection.

This being said, 40 000 listeners on a DOM node is surely not good. I
will have a look at the code, perhaps can I already improve the
situation. Nevertheless it would be good if you could look at your JS
code: if there are so much listeners, it means that there are so much
HTMLCollection instances that have been created and they could probably
have been cached. Any information is welcome.

Cheers,
Marc.
-- 
HtmlUnit support & consulting from the source
Blog: http://mguillem.wordpress.com



Le 22/09/2011 13:18, Vetle Roeim a écrit :
> Hi,
> 
> First off all, great work on HtmlUnit, it's amazing that it can handle
> all the crappy HTML and JavaScript I throw at it.
> 
> I'm using Selenium with HtmlUnit-driver on a Java EE 6 project (JSF
> and PrimeFaces[1] for the front-end), and after upgrading from
> Selenium 2.0b1 (which uses HtmlUnit 2.8) to Selenium 2.6.0 (which uses
> HtmlUnit 2.9), my test are running a lot slower. Are there any known
> issues with performance between 2.8 and 2.9?
> 
> I've tried to debug and profile a bit, but results are so far
> inconclusive. In one instance, I found that 75% of the time had been
> spent in com.gargoylesoftware.htmlunit.html.DomNode.addDomChangeListener,
> in particular on the method ArrayList.contains. An uncientific
> sampling reveals that the ArrayList in question can contain between 40
> 000 and 80 000 elements. This does not happen in 2.8, and comparing
> the code in 2.8 and 2.9, it seems that the code for calling
> addDomChangeListener has been changed - in 2.8 it's in
> HTMLCollection.getElements, and in 2.9 it's in
> HTMLCollection.init/initFromChildren.
> 
> In another instance I found a huge stack of calls to
> ComputeCSSStyleDeclaration.getCalculatedHeight/getContentHeight that
> seemed to go on forever, but only about 30 percent of the time was
> spent there.
> 
> Any ideas what all this is about and why things has slowed down so
> much in 2.9 compared to 2.8?
> For all I know it might be necessary to emulate a browser properly,
> but it would be nice to rule out anything else before we clean up our
> JavaScript and CSS. ;)
> 
> Regards,
> Vetle Roeim
> 
> [1]: http://www.primefaces.org/

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic