Deciding on when to use XmlDocument vs XmlReader

前端 未结 5 1087
陌清茗
陌清茗 2020-11-28 02:54

I\'m optimizing a custom object -> XML serialization utility, and it\'s all done and working and that\'s not the issue.

It worked by loading a file into an Xml

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 03:29

    There is a size threshold at which XmlDocument becomes slower, and eventually unusable. But the actual value of the threshold will depend on your application and XML content, so there are no hard and fast rules.

    If your XML file can contain large lists (say tens of thousands of elements), you should definitely be using XmlReader.

提交回复
热议问题