0

We have a .net app developed with visual studio 2008, the release version is on x86 platform.

It takes 10 secs to launch the app after installation on Windows 7.

The launch is slower on Windows server 2008 R2 and takes 37 seconds.

I had code which checks if the OS PLATFORM was windows 2008 server, and if yes it changes the registry value

HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing

from 23c00 to 23e00 (this will disable the CRL check for the System account).

But this did not change the launch time. The article is at http://social.msdn.microsoft.com/Forums/en-US/4f8fd6f4-f978-4478-ac15-a815d2e9ba1d/slow-to-start-a-app-with-uiaccess-true-on-windows-2008-r2-64bit?forum=winserver2008appcompatabilityandcertification

Any help is much appreciated.

ElectricRouge
  • 1,239
  • 3
  • 22
  • 33
Asha
  • 25
  • 1
  • 7
  • 37 seconds are a lot. I'm sure your application performs a lot of stuff...how these 37 seconds are split in those tasks? To read as: I would first _profile_ (even with a a simple log) where application spends time... – Adriano Repetti Feb 21 '14 at 15:20
  • How should I go about having a log for the performance of my application? Not done this before. I am looking at this article http://msdn.microsoft.com/en-us/library/dd264915.aspx. I will use intellitrace. – Asha Feb 21 '14 at 15:23
  • Hard to say without code but something that load in 10->37 seconds for sure performs many operations on startup (starting from your `Main()` method). Just add, before each **task** - not instruction - performed at startup, a line _like_: `System.IO.File.AppendAllText(@"startup.log", String.Format("{0}: My task", DateTime.Now);` (and as very first line in `Main()` method too). Pretty naive but you'll have a trace of every performed task at startup (and a **raw** time estimation). You won't solve your problem but you'll **narrow your search** to a manageable point. – Adriano Repetti Feb 21 '14 at 15:28
  • One difference I've noticed that causes a lot of extra time on Windows 7 over Windows XP is attempting to perform a DNS lookup on a dotted quad IP address. For example, `Dns.GetHostEntry("192.168.3.52").AddressList` will take considerably longer on Win7 over XP. Are you doing something like this at launch? – Steve Feb 21 '14 at 15:51
  • Thanks @Adriano. I installed Redgate ANTS Performance Profiler 8 and carried out a performance profile. As you said my main method which has a method call to check for SQl connection which gets the connection string from datasources of the SqlDataSourceEnumerator.This is consuming 29% of time. – Asha Feb 21 '14 at 21:30
  • No Steve, I am not doing anything like that at launch. It is a windows forms application. – Asha Feb 21 '14 at 21:32
  • @Asha 30% of time, you still have 7 seconds and 26 seconds. It's still a long time (does it spend all this time gathering data from SQL?). Anyway... – Adriano Repetti Feb 21 '14 at 21:59
  • I am looking at the this code, this one takes time too. This is the SQL checking thread process function that periodically checks if SQL is still alive. If SQL has halted or paused, the OnSQLFailed function is called which notifies subscribers. /// private void PeriodicCheck() { while( !MySQLDB._bStopped ) { Thread.Sleep( CHECK_SLEEP_TIME ); string stRef = string.Empty; if( !CheckConnection() ) { OnSQLFailed( new EventArgs() ); } } } – Asha Feb 24 '14 at 21:10

0 Answers0