Selenium IE XPath Enhancements

April 24th, 2008

I recently made some performance improvements to the ajaxslt XPath library Selenium uses to drive XPaths in IE. One user asked me whether those could be made available. The answer is, they’re already in the Core subversion trunk! So you can pull down a copy and see if it helps with your IE woes.

Thought I’d also expose the tool I mentioned earlier that I’ve been using to find the places to optimize. You can play with the jsprofile sample tests now without checking out any code. Cool!

Keep in mind that the sample Google News page contains very old news. :P

Anxiety

March 17th, 2008

Flurries. What does it even mean? Despite that, it sounds like the feeling. The body below disappears. Empty pit of stomach, in my chest a wrecking ball on its way through rice paper. When I concentrate on winning.

I make it to the final round, then the sinking feeling of being overwhelmed, the unbearable weight of failure. Caffeine-drain or something, throw if off finally and collapse with gratitude.

This is insight into me; I step out of the memory.

rt2500

February 28th, 2008

My 6-year old laptop is still puttering along. Recently updated the kernel, and had to rebuild the wireless driver. The card is an Asus wl-107. The latest beta of the rt2500 driver doesn’t work with recent kernels; you need to grab a nightly snapshot.

To get the card to work (as opposed to simply flashing its lights while the “network is unreachable”), something like the following script should be run. It used to work without the sleep command, but it’s more touchy now than it used to be.

# starts the rt2500 ra0 interface
ifconfig ra0 up
ifconfig ra0 192.168.2.20
route add default gw 192.168.2.1
sleep 15s
iwconfig ra0 mode managed essid  \
channel 1 key restricted 

Snowfall

February 12th, 2008

It is a luxury
to walk outside and be in the woods.
The silent mass of the woods -
the few cars that do pass are quiet
electric, almost.

Two inches, so far,
add a softness
to the ever-pockmarked Albany streets.
A traffic light changing over
may be admired for its perserverence
in increasing solitude.

Javascript Profiler

December 11th, 2007

I’ve recently been working on a cross-browser javascript profiler I call jsprofile. It’s finally beginning to take shape. The main idea was to be able to profile javascript in IE in addition to Firefox, as Firefox already has the excellent Firebug extension going for it. The main driver for wanting to profile in IE was the desire to analyze performance of the ajaxslt library’s XPath evaluation.

I ran a brief test using the same XPath I’ve been using for a while, on a snapshot of the Google News page, comparing IE7 against Firefox2. I used ajaxslt 0.8 . The results are quite interesting, download here in OpenOffice format: Ajaxslt Profiling Results

If my profiling results are correct (I acknowledge more rigor is possible (the “a script is running for a long time” dialog popped up several times when I was profiling IE7, taking some time to dismiss), but I just wanted to perform a quick test), several important trends are evident.

First, IE7 is way way slower than Firefox. But we knew that. ;)

Second, the results don’t equivocate about which method calls are taking the longest. The top four worthy of consideration for optimization are (in order of total time consumed): xPathStep, ExprContext, BooleanValue, and copyArray.

Third, the average own time for xPathStep is grossly larger in IE than in Firefox; 5.18ms, versus only 0.22ms.

Finally, perhaps the most surprising result is that the number of method calls differed on the browsers, even though the XPath used was exactly the same. Shockingly, both ExprContext and BooleanValue had 20x more invocations in IE! Are these extra calls really necessary? Are they an artifact of my still-maturing profiler code? I hope we can determine the potential for optimization here is real. :)

Update

It appears that the profiler (not surprisingly) misses a few key methods: compare, clone, and evaluate. I’ll have to look into it more, but my hunch is that these are either added dynamically or are added to object prototypes, which the profiler currently may not be able to detect. Out of curiousity, I profiled the profiler itself running the ajaxslt test, using Firebug. This is what revealed the missing methods, whose timings are likely the main contributors to xPathStep.

It was interesting to observe the average time for the profile entry and exit functions. Obviously, these can impact the accuracy of the results. The average time for both added together was about 0.02ms . In comparison, the average times for compare, clone, the longest running evaluate (there are several), and copyArray were 0.463ms, 0.048ms, 0.573ms, and 0.03ms, respectively.

I’ll see if I can get the profiler to automatically capture those missing methods. I’ve added the Google News test to the repository, so you can try it and see for yourself.


Bad Behavior has blocked 824 access attempts in the last 7 days.