Which is the best for performance wise: XPathNavigator with XPath vs Linq to Xml with query?
- 阅读更多 关于 Which is the best for performance wise: XPathNavigator with XPath vs Linq to Xml with query?
问题 I have an application in which I am using XPathNavigator to iterate nodes. It is working fine. But I want to know that if I use LINQ to Xml.... What benefits(Performance, maintainability) I will get? With XPath, LINQ to Xml what is the performance hit? I am using C#.net, VS 2010 and my .xml is mid size. 回答1: Well, XPathNavigator will generally be faster than Linq to XML queries. But there's always 'but'. Linq to XML will definitely make your code more readable and maintainable. It's easier