DeepCallInFork.message: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/performance/deep_call_in_fork.bend as DeepCallInFork Lines 167-173 of bend-lint-rules@0.2.0.0/performance/deep_call_in_fork.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/performance/deep_call_in_fork.bend&start_line=167&end_line=173 import Base def message(+callee: String, loop: String) -> String: callee ++ " calls itself outside a tail position, so Bend gives each of its calls a frame, and " ++ loop ++ " calls it in a fork (a value of its parallel let, or of a let just before it). CPU: measured 4% to 8% faster for a raytracer after the fix; in a benchmark, such a call at each fork cut a 10x speedup to 1.9x. GPU: such a recursion in a `!` made a draw 2.3x slower (\"bend guide shaders\"). JS: not measured. Confidence: medium, as the cost grows with the depth of the recursion. Make " ++ callee ++ " tail-recursive with an accumulator, compute its value with native operations (such as U32.shln), or compute it once and pass it down as a parameter. If its input is short, expect this finding." Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append