XML : Retrieval of same xml element from an xml file using XmlTextReader takes different time during successive execution

I am observing an interesting thing while fetching the inner xml of a particular xml element from an xml file.

I am using an xml file of 211 kb size.

Using Stopwatch I am finding that for fetching the same element in successive test runs, it's taking 2 to 6 milliseconds. I am using XmlTextReader for fetching the element

The position of the element in the file is also fixed.

Can anyone please let me know the reason behind it ?

Thanks in advance, Amit

No comments:

Post a Comment