saltstack/salt — pull request #2200 by thekuffs (2012-10-08 19:39:21+00:00)
Title: Fix windows meminfo

I was still unsatisfied with the ping times I would get with Windows minions that have multiprocessing enabled.

```
[root@MASTER ~]# time salt MINION test.ping
MINIONt: True

real 0m6.376s
user 0m0.201s
sys 0m0.066s
```

I hooked up some profiling harnesses and found that about 45% of the time consumed in a ping was spent on ```salt.grains.core._memdata()```. More specifically, on a call to the ```cmd``` module.

I stripped out the ```SYSTEMINFO``` call and replaced it with WMI and cut the ping time in half.

```
[root@MASTER ~]# time salt MINION test.ping
MINION: True

real 0m2.861s
user 0m0.188s
sys 0m0.073s
```

It's worth noting that there is still optimization to be done on the minion process forking in Windows. This is the same call with multiprocessing disabled:
```
[root@MASTER ~]# time salt MINION test.ping
MINION: True

real 0m0.273s
user 0m0.193s
sys 0m0.067s
```

This follows the work I did in #2177 and some of the discussion in #2123.