Performance of XPath vs DOM

前端 未结 3 761
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 07:00

Would anyone enlighten me some comprehensive performance comparison between XPath and DOM in different scenarios? I\'ve read some questions in SO like xPath vs DOM API, whic

3条回答
  •  攒了一身酷
    2020-12-29 07:40

    This page has a section where you can run tests to compare the two and see the results in different browsers. For instance, for Chrome, xpath is 100% slower than getElementById.

    See getElementById vs QuerySelector for more information.

提交回复
热议问题