Deciding on when to use XmlDocument vs XmlReader

前端 未结 5 1099
陌清茗
陌清茗 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:23

    The encoding difference is because two different measurements are being mixed. UTF-32 requires 4 bytes per character, and is inherently slower than single byte data.

    If you look at the large (100K) element test, you see that the time increasesw by about 70mS for each case regardless of the loading method used.

    This is a (nearly) constant difference caused specifically by the per character overhead,

提交回复
热议问题