My external fact script takes 5s to run.
With external fact...
Without external fact...
Bottom line... there's no significant change in facter runtime when parsing the external fact, but the puppet runtime quadruples.
From watching the logs in real time I can see that the extra time is taken before puppet outputs its first response line (compilation time). Also note that the compilation time that puppet reports is ~2s even though (when watching the output realtime) it takes 2 minutes for that line to return when puppet is parsing the external fact script.
[root@fisheye-10-0-2-15 manifests]# time /etc/facter/facts.d/service_discovery.sh
environment=test
...
service_discovery_script=ran
real 0m5.478s
user 0m0.053s
sys 0m0.111s
# Time of puppet run with external fact
[root@fisheye-10-0-2-15 manifests]# time FACTER_environment='vagrant' FACTER_role='fisheye' puppet apply --modulepath '/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' site.ppNotice: Compiled catalog for
fisheye-10-0-2-15.inin.com in environment production in 2.22 seconds
Notice: Finished catalog run in 30.76 seconds
real 2m25.856s
user 0m5.124s
sys 0m3.830s
#Time of facter with external fact
[root@fisheye-10-0-2-15 manifests]# time facter
analyticsapisegmentindexconsusmerwaittimeseconds => 1
architecture => x86_64
...
uptime_hours => 0
uptime_seconds => 2529
real 0m33.587s
user 0m0.658s
sys 0m0.849s
#Removing external fact script
[root@fisheye-10-0-2-15 manifests]# rm /etc/facter/facts.d/service_discovery.sh
rm: remove regular file `/etc/facter/facts.d/service_discovery.sh'? y
[root@fisheye-10-0-2-15 manifests]# ls /etc/facter/facts.d/
#Time of puppet run without external fact script
[root@fisheye-10-0-2-15 manifests]# time FACTER_environment='vagrant' FACTER_role='fisheye' puppet apply --modulepath '/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' site.pp
Notice: /Stage[main]/System::Facts/Facter::Fact[service_discovery]/File[/etc/facter/facts.d/service_discovery.sh]/ensure: created
Notice: Finished catalog run in 23.22 seconds
real 0m27.550s
user 0m4.408s
sys 0m2.292s
# Removing script again (cuz puppet run put it back)
[root@fisheye-10-0-2-15 manifests]# rm /etc/facter/facts.d/service_discovery.sh
rm: remove regular file `/etc/facter/facts.d/service_discovery.sh'? y
[root@fisheye-10-0-2-15 manifests]# ls /etc/facter/facts.d/
#Time of facter run without external script
[root@fisheye-10-0-2-15 manifests]# time facter
architecture => x86_64
augeasversion => 0.9.0
...
virtual => virtualbox
real 0m0.687s
user 0m0.324s
sys 0m0.287s