Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance improvements #124

Closed
wants to merge 2 commits into from

Commits on Jul 4, 2023

  1. Do not query for the exact facter version

    This assumes that no exact match can be found in most cases. This saves
    a call to Facterdb. Some testing on puppet-nginx this reduced the time
    for a dry run by about 1 to 2 seconds, from about ~11 to ~9 seconds.
    
    Actual results will vary on the FacterDB. Note that a new Facter version
    will trigger the bad code unless all operating systems are updated so
    this is a very likely code path.
    
    It also makes the easier to read.
    ekohl committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    35f5209 View commit details
    Browse the repository at this point in the history
  2. Collect facts iteratively

    Rather than getting the facts for every filter spec and then discarding
    that, this stores the found facts in an array and uses that.
    
    This eliminates a call to FacterDB::get_facts with a very complex
    filter.
    
    A quick test in puppet-nginx reduces loading of tests by about 2 seconds
    (from ~9 to ~7).
    ekohl committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    0c9397f View commit details
    Browse the repository at this point in the history