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

Do not store Puppet stack within Ruby stack / Backport master work to 5.5.x

    XMLWordPrintable

Details

    • Froyo
    • Enhancement
    • Hide
      Puppet manifests that make use of stdlib's `deprecation` function, use the pseudo keywords `break`, `return`, and `next`, experience serialization warnings, or have custom Ruby code that makes use of the `PuppetStack.top_of_stack` function should see a marked increase in performance.
      ---

      Release note: Performance of manifests that use the `PuppetStack.top_of_stack` function have been greatly improved. This includes manifests that use the puppetlabs-stdlib `deprecation` function or the pseudo keywords `break`, `return`, and `next`. [PUP-10170](https://tickets.puppetlabs.com/browse/PUP-10170)
      Show
      Puppet manifests that make use of stdlib's `deprecation` function, use the pseudo keywords `break`, `return`, and `next`, experience serialization warnings, or have custom Ruby code that makes use of the `PuppetStack.top_of_stack` function should see a marked increase in performance. --- Release note: Performance of manifests that use the `PuppetStack.top_of_stack` function have been greatly improved. This includes manifests that use the puppetlabs-stdlib `deprecation` function or the pseudo keywords `break`, `return`, and `next`. [ PUP-10170 ]( https://tickets.puppetlabs.com/browse/PUP-10170 )
    • Needs Assessment

    Description

      Puppet evals functions with a custom binding to make it look like the Puppet function is part of the Ruby callstack. When needing to find the "Puppet callstack" we then use Ruby's `Kernel.caller()` method to retrieve the whole callstack and filter out the Puppet files that we inserted when we called eval.

      Neverminding putting `Kernel.eval` in the middle of our compilation loop, this callstack handling has become significantly slower in JRuby 9k as it introduced its own bytecode compilation (it must reconstruct the Ruby frames and there's 2-3x as many associated Java ones).

      The PuppetStack.top_of_stack feature is used in stdlib's `deprecation` function, the internal `break`, `return`, and `next` pseudo-keywords, and in non-fatal warnings like trying to serialize Hashes with numbers as keys. `Kernel.caller()` is effectively called for every instance of the above and considerably slows compilation in manifests that make heavy use of them.

      Instead of using the Ruby callstack as a data structure, managing the Puppet stack within its own Array was done in master (erroneously as a 'maint' commit in my free time). This ticket documents that work as well as the need to backport it to other maintained branches.

      Prior to the next release we should also consider PUP-10150 as a completer for this work.

      Attachments

        Issue Links

          Activity

            People

              justin Justin Stoller
              justin Justin Stoller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support