mascip has asked for the wisdom of the Perl Monks concerning the following question:
XPath queries are "fairly slow" (compared to running around in a Tree for example), and i read here that XSH could possibly make them a lot faster.
Explanation by Randal L. Schwartz :
"The XSH version (even considering the compilation of the XSH language into Perl before running) takes about one seventh the time of the HTX (HTTP::TreeBuilder::XPath) version.
I was surprised at the difference, so I did a bit of exploration and found that that the HTX version was spending almost all of its time building the huge Perl data structure to represent the DOM. Because XSH doesn't need to do that (the DOM is in C-side data structures), we get a tremendous savings in time, not to mention quicker queries later."
Would it be possible to get this speed by "plugging" (simple words for simple understanding) WWW::Mechanize::Firefox and XSH ?
Thank you =o)
PS : I guess my alternative solution would be to use Trees most of the time, and XPath only when i really need it. For example for retrieving an element's position on the screen : 951038
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Naive idea : using XSH with WWW::Mechanize::Firefox, to make faster XPath queries ?
by Anonymous Monk on Feb 06, 2012 at 11:26 UTC | |
by mascip (Pilgrim) on Feb 06, 2012 at 11:29 UTC | |
|
Re: Naive idea : using XSH with WWW::Mechanize::Firefox, to make faster XPath queries ?
by Anonymous Monk on Feb 06, 2012 at 11:28 UTC | |
by mascip (Pilgrim) on Feb 06, 2012 at 11:42 UTC | |
by Anonymous Monk on Feb 06, 2012 at 12:37 UTC | |
by mascip (Pilgrim) on Feb 06, 2012 at 19:58 UTC | |
by mascip (Pilgrim) on Feb 06, 2012 at 20:04 UTC |