puppetlabs/puppet — pull request #913 by daniel-pittman (2012-07-10 22:38:15+00:00)
Title: Perf/2.7.x/eliminate require in functions

Calling `require` is a surprisingly expensive operation, especially if
ActiveRecord has been loaded. Consequently, the places where we do that in
the body of a function are hot-spots in the profile.

They are also, generally, pretty simple and clear wins: almost all of them can
simply require the library the first time they are loaded and everything will
work fine.

In my testing with a complex, real-world set of manifests this reduces time
spent by ~ 3 wall-clock seconds in require and all children.

Signed-off-by: Daniel Pittman