Details
-
Improvement
-
Status: Resolved
-
Normal
-
Resolution: Done
-
None
-
None
-
Froyo
-
Enhancement
-
-
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
- relates to
-
PUP-10150 Ruby stacktraces no longer interleave Puppet Code stacktraces
-
- Resolved
-