Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-11322

Excessive copying of already merged code for the main hostclass

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Won't Do
    • None
    • None
    • None
    • None
    • Phoenix
    • Needs Assessment
    • Needs Assessment

    Description

      When parsing manifests, we merge the main hostclass' code. Each merge creates a new BlockExpression containing the children from the old and new codes: https://github.com/puppetlabs/puppet/blob/e0ea9a23bc867d337abf6c9d274e46729b058f15/lib/puppet/resource/type.rb#L145

      This means we're copying the code that has already been merged into self N times and the array gets bigger each time. The many_modules benchmark creates 100 modules each with 11 manifests and it generates an extra 11MB of allocated memory.

      It seems like we should be appending the new code with the already merged code while preserving the flattening behavior.

      Attachments

        Issue Links

          Activity

            People

              josh Josh Cooper
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support