0

There are multiple ways of reading XML's and performing business logic. The Business object can be reading, writing, Editing and getting required values many times. The XML file size also very large in GB's but mostly in MB's. Based on the performance wise which approach suits best .

  1. XMLreader
  2. XMLSerialization
  3. Linq to XML
  4. StreamReader
  5. XML Dom parsing
Jagadesh
  • 264
  • 6
  • 16

2 Answers2

0

Probably doesn't matter ...

Unless you're using huge ... and I mean HUGE ... xml's ... or doing it for sooooooooooo many times that that is the bottleneck ...

You could always benchmark them yourself as well ...

The other question is ...what do you need?

If you need to read and write one might be more relevant than the other. If you just need to read, the one who offers right will be "slow" in comparison ...

It's a very wide question you ask ... without sufficient details...

Noctis
  • 11,507
  • 3
  • 43
  • 82
  • You did, but you didn't made it any better ... you say "for any use, this or that, big or small" ... can't really help with that. It's too wide. I doubt that will be your bottleneck as I said. Unless that's the only thing your program does (parse xml). Go with the one you know how to use and is easy to follow. If you run into issues in the future, rely on the fact you wrote it PROPERLY the first time, so you can easily change the way you work with your reader (Have it behind an Interface, so you're not tied to the specific use). – Noctis Nov 14 '13 at 06:13
0

Well. it depends upon the specific application where you are trying to use it. But in theory, Linq is the best as far as performance is concerned.

CinCout
  • 9,486
  • 12
  • 49
  • 67
  • If the file size is very huge and required to handle that xml at many times, is performance will hinder.? – Jagadesh Nov 14 '13 at 06:13
  • @Jagadesh What do you mean when you say "handle that xml at many times". If you refer to parsing it and reading it to fetch some data, both XPath and LINQ are good. But LINQ queries are more readable when compared to XPath. – CinCout Nov 14 '13 at 06:22