IEDriverServer considerably slower between 3.4 and 3.7
Meta -
OS: Windows Server 2012 Selenium Version: .NET bindings, 3.5.1, IEDriverServer 3.4 / 3.7 Browser: Internet Explorer Browser Version: 11.0.9600.17416
We recently tried upgrading from Selenium 3.4 to a newer version. After the upgrade, our tests are running considerably slower. After some trial and error, we found that using the previous version of the IEDriverVersion (3.4) restored the tests to their original speed. The slow-down is roughly 1.5 to 2 times (varies per test). We added some trace logging, and the logfiles have also become much bigger (log files can be provided if useful).
I have checked with versions 3.5, 3.6 and 3.7, which are all affected.
Expected Behavior -
Tests run with the same speed using IEDriverServer 3.4 or the latest
Actual Behavior -
Tests run much slower with the latest version
Steps to reproduce -
Just run the test with either version 3.4 or 3.7 of the IEDriverServer
I strongly suspect the issue has happened in the refactoring of the actions pipeline in 3.5 to coincide with the making the driver compliant with the W3C WebDriver Specification. Pull requests welcome.
Had this issue when I tried to update to 3.6.0. But then recognized I was using 32 bit IEDriverServer while my browser was 64-bit which made it super slow. Updating to correct version fixed the issue. Please confirm its not the same in your case.
@jimevans : Hm... that does not sound like something that would be easy to jump into without any prior knowledge, would it?
Compared to Chrome and/or Safari IE11 testing was already the slower one, but now it got to the point where our tests are timing out because of the additional slowness. Is it anywhere on your roadmap to look in to performance degradations?
@AdvanceAutomation : We are using the 32 bit version of the IEDriverServer.
@rhpijnacker What roadmap? Of course, it’s something I want to try to look at, but since I work on he IE driver on an uncompensated volunteer basis, it’ll have to wait for availability, absent someone else putting in the time and effort.
@jimevans Roadmap/todolist/sticky notes, whatever you prefer ; )
@rhpijnacker try 64 bit IEDriver and if you still see the issue then its a new performance bug for the IEDriver. Also I hope you understand Selenium is open source. People are putting their free time and contributing to it. Its people like @jimevans who make this a possibility. I would suggest supporting them.
@jimevans I hope you did not take any offence to my questions. That was certainly not my intention. Suppose I would spend some time to fix this, what would be a good place to start?
@rhpijnacker - If you wish to contribute..

Hi, i reproduce this issue to and I made a script in Python which can use differents ie driver versions to test this regression. Also i attached the timings obtained, from 3.4 to 3.8 (including 3.5.1 and both 32b and 64b versions).
I'll try to figrued out what happened and fix the problem
This script could also be used to avoid this kind of regression.
Hope this will help...
Script usage : python "path_to_script"\selenium_timing_issue.py DRIVER=IEDriverServer[XX_VV].exe XX= 32 or 64 VV = 34 to 38 (including 351)
I pull a request that improves IE performance. This leads to same completion time as previously in the 3.5.1. I did not find update allowing to find the time of 3.4.0
@Nawakator I've commented on your PR, but just to let a wider number of people know, your PR would make the IE driver non-compliant with the W3C WebDriver Specification.
Okay, I've done some debugging on this issue. With the exception of the changes to mouse move (which aren't going away), I'm more convinced that the changes to the Actions end point are not to blame. Even removing the loop breaking up mouse moves into a series of discrete steps does not return the performance to pre-3.5 levels. I've a commit that removes a few sleeps in the action processing, and optimizes element.click() to no longer use the "break up the mouse move" part, but that does not resolve the issue. We're going to need more detailed data to figure out where the drop in performance could be. I'm also out of time to devote to looking at the issue for the moment.
@g0rk4 I've adapted your test locally, and that's what I'm using to justify the above information. I've done an apples-to-apples comparison, running the test on a localhost server, so as not to introduce internet latency. Here's what I found (times in seconds):
| Step | 3.4.0 | Head revision |
|---|---|---|
| Step 1 Navigation | 0.24 | 0.267 |
| Step 2 Frame switching | 0.706 | 0.822 |
| Step 3 Element text retrieval | 0.677 | 0.663 |
| Step 4 Element verification | 0.526 | 0.508 |
| Step 5 Wait for element disappear | 8.723 | 11.623 |
| Step 6 Paste text | 1.238 | 2.261 |
| Step 7 Element clear | 3.205 | 4.013 |
| Step 8 Element click | 0.804 | 2.548 |
| Step 9 Element move to | 0.489 | 1.289 |
| Step 10 Element check | 0.966 | 2.99 |
| Total elapsed time | 17.569 | 27.04 |
Steps 8, 9, and 10 use an explicit Actions call, so I would expect those to require a larger time, due to the requirement in the spec that when a duration is specified for an actions tick, that the tick should last for the specified duration (hint: the language bindings specify a duration for mouse movement for W3C-compliant driver).
I'm not giving up on fixing this, just that the place where previous efforts were concentrated have not yielded more than single-digit-millisecond changes in timing. And it will likely be months before I can devote more time to tracking it down.
One more update. I had an idea before calling it quits yesterday on how to profile the individual WebDriver commands in the aforementioned test, which yielded some interesting results. Except for explicit “actions” calls (moveToElement, etc.), the slowdowns appear to be localized to WebElement.click() and WebElement.isDisplayed(). I’ve found and fixed locally the cause of the former; the latter may be due to a refactor of how the W3C Specification insists isDisplayed must be implemented.
Alright, I've made some modifications to the IE driver that at least partially mitigate the perf issues encountered since 3.5. As such, I'm going to close this issue now. A prebuilt version with these changes (version 3.9.0.2) is committed to the tree in cpp/prebuilts/Win32/Release. They will be made widely available when 3.10.0 is released (no release date is forthcoming). If there are other specific performance issues, please open new issue reports.
Great, Jim! Thanks for the good work.