LINQ to XML的性能
http://www.nearinfinity.com/blogs/page/jferner?entry=performance_linq_to_sql_vs
可以看哈评论。我的看法基本还是使用XMLReader好,但XmlDom与Linq to Xml比,Linq to XML还是要好一些。
http://blogs.msdn.com/ericwhite/archive/2009/07/20/a-tutorial-in-the-recursive-approach-to-pure-functional-transformations-of-xml.aspx
UTF8Encoding
1 | 10 | 100 | 1,000 | 10,000 | 100,000 | |
---|---|---|---|---|---|---|
XmlDocument | 0.1567800 | 0.1713450 | 0.3888620 | 1.9816480 | 22.8049260 | 459.8570340 |
XmlReader | 0.1467460 | 0.1439580 | 0.2300500 | 0.8534400 | 7.5771640 | 76.8635690 |
LINQ to XML | 0.1499530 | 0.1500640 | 0.2778720 | 1.4616730 | 15.7719020 | 208.9360300 |
ASCIIEncoding
1 | 10 | 100 | 1,000 | 10,000 | 100,000 | |
---|---|---|---|---|---|---|
XmlDocument | 0.1659350 | 0.1922080 | 0.3433140 | 1.9846330 | 22.5484690 | 482.8699720 |
XmlReader | 0.1376840 | 0.1453730 | 0.2199810 | 0.8768260 | 7.9187380 | 77.7760560 |
LINQ to XML | 0.1345900 | 0.1573340 | 0.2848420 | 1.4889930 | 15.1504500 | 214.9338990 |
UTF32Encoding
1 | 10 | 100 | 1,000 | 10,000 | 100,000 | |
---|---|---|---|---|---|---|
XmlDocument | 0.1672370 | 0.1799780 | 0.4156250 | 2.7188370 | 30.6423960 | 543.4604540 |
XmlReader | 0.1386820 | 0.1503870 | 0.2867400 | 1.4981070 | 14.4428430 | 152.7660780 |
LINQ to XML | 0.1317060 | 0.1866610 | 0.5385940 | 2.3631290 | 21.4566290 | 274.3280280 |