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

Functions are slower if called with chained syntax than with prefix syntax

    XMLWordPrintable

    Details

    • Template:
      PUP Bug Template
    • Agent OS:
      CentOS 7
    • Master OS:
      CentOS 7
    • Sub-team:
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      The puppet language supports calling functions using prefix or chained syntax, for example, "each($var)" and "$var.each", respectively. Using the latter syntax is now much faster, especially when $var is a large hash, such as $facts from the node.
      Show
      The puppet language supports calling functions using prefix or chained syntax, for example, "each($var)" and "$var.each", respectively. Using the latter syntax is now much faster, especially when $var is a large hash, such as $facts from the node.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 5.5.17
      Puppet Server Version: 2018.1
      OS Name/Version: Centos 7

       

      Desired Behavior:

      As documented in https://puppet.com/docs/puppet/5.5/lang_functions.html#chained-function-calls, chained function call syntax should result in same behaviour as prefixed syntax.

      Actual Behavior:

      Using chained syntax results in slower performance of the function call. The performance depends on the size of the object "before the dot".

      Examples:

      Run puppet apply test.pp --debug --profile

      Please see attached:

      • test.pp
      • test.log

        Attachments

        1. test.log
          1.11 MB
        2. test.pp
          0.2 kB

          Issue Links

            Activity

              People

              Assignee:
              josh Josh Cooper
              Reporter:
              dimitri.tischenko Dimitri Tischenko
              Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support