I need to use XmlDocument or HAP to parse several files, what is the fastest way to do it? I have an i7 processor, but the processor is using hardly 30% no matter how many threads I use. Each thread parses a different file.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
System.Xml.Linq.XElement.Parse()is faster thanXmlDocument.LoadXml()for parsing XML strings, and XElement.Load() will parse directly from a file. You may also find LINQ to XML much easier to use.But if you want to work with XmlDocument, then you can use
And as others suggested, you probably won’t hit 100% CPU utilization since the i7 may parse much faster than the hard disk can send data.