0

The first load of Custom-Settings takes around 2 seconds every time the application is started.

Is there some way to accelerate it?

(Or is this widely used, as suggested here, despite the speed penalty.)

Here's the code:

public class MySettings : ApplicationSettingsBase
{
    [UserScopedSettingAttribute()]
    public int MyInt
    {
        get { return (int)(this["MyInt"]); }
        set { this["MyInt"] = value; }
    }
}

And called so:

MySettings s = new MySettings();
int i = s.MyInt;
Community
  • 1
  • 1
ispiro
  • 26,556
  • 38
  • 136
  • 291
  • How are you timing it? – qxn Jul 30 '13 at 20:50
  • @ken Breakpoint + F10. – ispiro Jul 30 '13 at 20:51
  • You may be timing the debugger. Use a System.Diagnostics.Stopwatch and run the compiled code in a console or forms application. – qxn Jul 30 '13 at 20:54
  • 1
    @ken Still over 1200 ms in Release mode. And this is a simple case. In the real case - the object is more complex and might take even more time. But in any case - that's too long. – ispiro Jul 30 '13 at 21:01

0 Answers0