Issue #3294299 by phma, alexpott, pooja saraah, mikelutz: Regression in functional test performance with a large number of modules (cherry picked from commit fea90e52)