I added another set of tests without group locating and here are the
results I tested in my Linux box with Firefox 2.

Final results:
 TestName: testFlowByDefaultXPath, TotalTime: 44432ms, RepeatCount: 2,
AverageAccumulatedTime: 13502ms
 TestName: testFlowByJavascriptXPath, TotalTime: 38527ms, RepeatCount:
2, AverageAccumulatedTime: 13528ms
 TestName: testFlowByJQuerySelector, TotalTime: 42404ms, RepeatCount:
2, AverageAccumulatedTime: 14776ms
 TestName: testFlowByDefaultXPathNoGroup, TotalTime: 38111ms,
RepeatCount: 2, AverageAccumulatedTime: 13488ms
 TestName: testFlowByJavascriptXPathNoGroup, TotalTime: 41408ms,
RepeatCount: 2, AverageAccumulatedTime: 13420ms
 TestName: testFlowByJQuerySelectorNoGroup, TotalTime: 54359ms,
RepeatCount: 2, AverageAccumulatedTime: 14643ms
 TestName: testGetDataByDefaultXPath, TotalTime: 90851ms, RepeatCount:
2, AverageAccumulatedTime: 44811ms
 TestName: testGetDataByJavascriptXPath, TotalTime: 91112ms,
RepeatCount: 2, AverageAccumulatedTime: 44755ms
 TestName: testGetDataByJQuerySelector, TotalTime: 1665ms,
RepeatCount: 2, AverageAccumulatedTime: 165ms

Where TotalTime is the total test run time, RepeatCount is the number
of repeated tests. AverageAccumulatedTime is the average time
for the time the code spent on a list of test methods that we think
are not affected by network latency, which should be more accurate
than the TotalTime.

Seems jQuery Selector is a bit slower than XPath in Firefox, but
almost at the same speed (This also means there are room for us
to improve the jQuery selector). But for Bulk data, jQuery is way
better since it only uses one method call.

Hope someone can checkout the benchmark project and provide us the
results in IE and other web browsers.

Thanks,

Jian


On Apr 15, 12:30 pm, Jian Fang <[email protected]> wrote:
> Also, why you have * before "table#MVContentPredictionsTable"? "*" matches
> all and does not really contribute
> to anything, but may cause some performance problem, thus jQuery selector
> will automatically skip that. Could you remove the "*" and re-run the code?
>
> Thanks,
>
> Jian
>
> On Wed, Apr 15, 2009 at 12:01 PM, dominicm <[email protected]>wrote:
>
>
>
> > Hi All,
>
> > I've conducted some very basic relative timings for JQuery vs XPath
> > selectors in Selenium, using the same rather old and difficult
> > frontend code as I used when baselining css selectors.
>
> > Code is as follows:
>
> > Use faster XPath library
> > sel.useXpathLibrary("javascript");
> > sel.isElementPresent("//descendant-or-self::*/descendant-"+
> >        "or-self::tab...@id='MVContentPredictionsTable']/tbody/tr[child::td]
> > [8]/td[5]/des"+
> >        "cendant-or-self::*");
>
> > sel.getText("//descendant-or-self::*/descendant-"+
> >        "or-self::tab...@id='MVContentPredictionsTable']/tbody/tr[child::td]
> > [8]/td[5]/des"+
> >        "cendant-or-self::*");
>
> > sel.isElementPresent("jquery=* table#MVContentPredictionsTable > tbody
> > > tr:has(td):eq(8) > td:eq(5)");
> > sel.getText("jquery=* table#MVContentPredictionsTable > tbody > tr:has
> > (td):eq(8) > td:eq(5)");
>
> > Performance for the above for both JQuery and css was appalling,
> > taking over 2 minutes in total, compared to 20secs for XPath.
>
> > The only way I could get JQ to respond in a decent time (4secs) was to
> > modify the selector to
> > "jquery=*#MVContentPredictionsTable > tbody > tr:has(td):eq(8) > td:eq
> > (5)"
> > but this did not find the correct element
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to