title: How to correctly instantiate Classes, Variables and Objects for best performance?
body: <p>I'm creating a GUI in C# and I'm trying to increase the starting/loading performance, because I have to load a lot of stuff in other classes.</p>
  
  <p>I've read something about late and early binding, but I think both ways are early binding in .NET.</p>
  
  <p>I have a basic question and I try to figure out what's the best way to instantiate classes / variables: directly at the beginning or in the constructor? Or does it make no matter for the Compiler ?</p>
  
  <p>I have 2 options, which is the better (faster) option?</p>
  
  <p><strong>Option 1:</strong></p>
  
  <pre><code>public partial class MainClass : Window
  {
  
      private SomeClass someClass1;
      private OneMoreClass someClass2;
      //....
      private String someString;
      private int someInt;
  
  
      public MainClass()
      {
          this.someClass1 = new SomeClass();
          this.someClass2 = new OneMoreClass();
          this.someString = "test 12345";
          this.someInt = 42;
      }
  
      // ....
  }
  </code></pre>
  
  <p><strong>Option 2:</strong></p>
  
  <pre><code>public partial class MainClass : Window
  {
  
      private SomeClass someClass1 = new SomeClass();
      private OneMoreClass someClass2 = new OneMoreClass();
      //....
      private String someString = "test 12345";
      private int someInt = 42;
  
  
      public MainClass()
      {
          // nothing to construct
      }
  
      // ....
  }
  </code></pre>