XElement vs Dcitionary

Posted by user135498 on Stack Overflow See other posts from Stack Overflow or by user135498
Published on 2009-09-12T16:44:07Z Indexed on 2010/04/27 8:33 UTC
Read the original article Hit count: 335

Filed under:
|
|
|
|

Hi All,

I need advice. I have application that imports 10,000 rows containing name & address from a text file into XElements that are subsequently added to a synchronized queue. When the import is complete the app spawns worker threads that process the XElements by deenqueuing them, making a database call, inserting the database output into the request document and inserting the processed document into an output queue. When all requests have been processed the output queue is written to disk as an XML doc.

I used XElements for the requests because I needed the flexibility to add fields to the request during processing. i.e. Depending on the job type the app might require that it add phone number, date of birth or email address to a request based on a name/address match against a public record database.

My questions is; The XElements seems to use quite a bit of memory and I know there is a lot of parsing as the document makes its way through the processing methods. I’m considering replacing the XElements with a Dictionary object but I’m skeptical the gain will be worth the effort. In essence it will accomplish the same thing.

Thoughts?

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about xelement