Skip to content

perf tests: Increase default stack size for MultiLayerModules

The MR implements a better fix for #19293 (closed), which was discovered while debugging the metric decreases in !10729 (closed). As described in Note [Increased initial stack size for MultiLayerModules], a few tests apparently spawn threads that need almost exactly 1k of stack, so tiny changes to the amount of stack required would change whether the stacks would overflow. Since a stack overflow involves a 32k allocation, this could have a very large impact on bytes allocated (though probably not an especially large impact on residency).

The difficulty of identifying this issue is unfortunately not surprising to me. It is currently very hard to determine whether a program is triggering stack-related performance pathologies, and even when it can be identified, it is not always clear what the appropriate fix is. I think it may be worth considering whether some better stack resizing strategy could help Haskell programs more generally, but that is well outside the scope of this patch.

Merge request reports