George Ritzmann has the correct answer.
To understand the execution time of a find we must first understand what a find does and why the different By's would have different execution speed and what could cause it.
So we start with the Find methods inside of the RemoteWebDriver object. This calls to execute DriverCommand.FIND_ELEMENT. Execute calls the HttpCommandExecutor which sends the find request to the WebDriver.
I am going to skip over a few steps at this point because quite frankly, it's extremely convoluted. At this point though the request is forwarded on into the browser. Based on older implementations of the WebDriver, it was solely JS driven. The issue with it being JS driven is that it will vary greatly from one browser to the next.
This can be evident by using IE, especially older versions. IE's JS engine was notoriously slow for XPath and slightly quicker for CssSelectors.
Since this implementation takes place differently for each browser, there sadly is not a surefire answer to this question. It can vary from one WebDriver to the next. But the standard is the one posted above due to simplicity.
Some other important things to take into consideration when choosing the way that you decide to implement your selectors:
- Team Skill
- Frequency of change