Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ConfigurationChangeWatcher.Poller()

When I profile my application , it seems that 70% of the time is spent in the method: Microsoft.Practices.EnterpriseLibrary.Configuration.Storage.ConfigurationChangeWatcher.Poller() From what I can gather this method should only be invoked every 50 seconds so I find it hard to believe that it is actually taking up that much time. Does anyone know how can I reduce the frequency that this method is called?

like image 403
Banketeshvar Narayan Avatar asked Nov 10 '22 10:11

Banketeshvar Narayan


1 Answers

I'm surprised that in an application that is doing real work that a timer thread that executes once every 15 seconds (the default) and looks to just be comparing file times is taking up so much time.

What if you try to set the timer interval to a longer interval sometime after initializing Enterprise Library:

ConfigurationChangeWatcher.SetDefaultPollDelayInMilliseconds(int.MaxValue);

If you do that does the time spent decrease?

Also, if you use the FileConfigurationSource class programmatically there is a constructor overload to disable watching for configuration file changes.

like image 154
Randy supports Monica Avatar answered Nov 15 '22 08:11

Randy supports Monica