title: Which is faster to get running processes WMI or System.Diagnostics.Process?
body: <p>I'm developing a small remote task manager application [server/client] on LAN using WCF service lib.</p>
  
  <p>I need to know which way is faster to get processors information: </p>
  
  <ul>
  <li>getting processes info from <code>System.Diagnostics</code>?</li>
  <li>getting processes info from <code>WMI</code>?</li>
  </ul>
  
  <p>I'm using the first options now, but if the application is x86, and the process is x64 then I can't access to <code>Process.MainModule</code>, so it forces me to create two versions of my application to get it work on any PC, x86 version and x64.</p>
  
  <p>So if I used WMI would I face the same issue?</p>
  
  <pre><code>public void GetProcesses()
      {
          foreach (Process p in Process.GetProcesses())
          {
              try
              {
                  InfoProcess process = new InfoProcess(p.Id, p.MainModule.ModuleName, p.MainModule.FileVersionInfo.FileDescription, p.WorkingSet / 1024);
                  PrintProcess(process);
              }
              catch
              { }
          }
      }
  
  
  public class InfoProcess
  {
      public int Id;
      public string Name;
      public string Description;
      public int WorkingSet;
      public InfoProcess(int Id, string Name, string Desc, int WorkingSet)
      {
          this.Id = Id;
          this.Name = Name;
          this.Description = Desc;
          this.WorkingSet = WorkingSet;
      }
  }
  </code></pre>
  
  <p>If WMI is better, I need a little help with properties names that gives me:</p>
  
  <ul>
  <li><code>Process.WorkingSet</code></li>
  <li><code>Process.MainModule.FileVersionInfo.FileDescription</code></li>
  </ul>