Hi,
I am using the below code to read an XML file from virtual directory (application hosted in IIS)
DateTime beforeStart = DateTime.Now; var document = XDocument.Load("http://WindowsServer2008R2Machine/Site/ConfigurationFiles/Configuration.xml"); DateTime afterCompletion = DateTime.Now; TimeSpan timeDiff = afterCompletion.Subtract(beforeStart); MessageBox.Show("XDocument.Load took ~14 Milliseconds");
Trail 1:
Approach1: IIS present in Windows Server 2008 R2. XDocument.Load() code takes ~14 seconds.
Approach2: IIS present in Windows Server 2008 R2. Application.GetRemoteStream() code takes ~14 seconds.
Approach3: IIS present in Windows Server 2008 R2. XMLDocument.Load() code takes ~13 seconds.
All these approaches timings are so consistent for first time application launch but second time read onwards it takes less than 100 milli seconds.
Trail 2:
Approach1: IIS present in Windows Server 2008 R2. XDocument.Load() code takes > 100 ms.
Approach2: IIS present in Windows Server 2008 R2. Application.GetRemoteStream() code takes > 100 ms.
Approach3: IIS present in Windows Server 2008 R2. XMLDocument.Load() code takes > 100 ms.
No first time business here. Every time above 3 approaches takes > 100 milliseconds.
During My application start up, I need to read the XML file to get the configuration. Due to above reasons, whenever I connect to Windows Server 2008 R2, application start up takes long time.
Do I need to upgrade / update Windows Server 2008 R2 machine?
Could some one please help me solving this or any workaround?
Thanks and Regards
Harish Reddy Arumalla
Senior Software Engineer
Yokogawa IA Technologies Pvt Ltd, Bangalore