puppetlabs/facter — pull request #802 by joshcooper (2014-10-10 18:38:09+00:00)
Title: (FACT-720) Memoize WMI query results

Previously, facter would execute the same WMI queries repeatedly, which is
very slow, as in facter takes nearly 10 seconds to execute.

This commit memoizes the WMI query results, resulting in facter executing in
less than 4 seconds.

Note the IP related facts still query for their specific property on the
adapter, e.g. select IPAddress FROM Win32_NetworkAdapterConfiguration,
select IPSubnet, select MACAddress, etc. Additional speedup could be attained
by reworking the ip related facts to return all necessary properties in
one query, but is too much work to justify the gain.