What I mean is, is it faster to you "XMLNODE.SelectSingleNode" many times or should I first get its value into some string and then use that string many times?

02-08-2008

rags_to_riches

You should benchmark it if you're really interested in this, but...

While it is possible that the JIT compiler will optimize this at run-time, based on looking at the IL it appears that the second is likely quicker (which is what I would have suspected without optimization). There was no difference I could find between Debug and Release mode (optimized) code either.

While it is possible that the JIT compiler will optimize this at run-time, based on looking at the IL it appears that the second is likely quicker (which is what I would have suspected without optimization). ...
[/code]

Thanks, I think so too. Specially if the XML is large, the seconds seems like a better solution.