We've noticed a slowdown in our Jest tests after upgrading to @knapsack-pro/jest v5.4.1 and using the KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE option. What we're seeing is that the execution behavior of batches is very different and not optimized, leading to our Jest steps taking about 9 minutes (up from about 6 minutes). I've tried downgrading just the @knapsack-pro/core library from v4.0.0 to both v3.3.1 and v3.3.0, but did not see any change in behavior. However, reverting back from using KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE to KNAPSACK_PRO_TEST_FILE_PATTERN is what resolves the problem.
Here's a comparison of the two:
KNAPSACK_PRO_TEST_FILE_PATTERN
With this approach, you can see that the batches start with the slowest ones and get faster, leading to better durations when parallelized.

KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE
With this approach, you can see that the batches are not organized and as a result lead to many more batches being executed and durations taking much longer.

I tried to look through the changes, but didn't find an explanation for why the batching behavior would be different between the two approaches so I'm creating this issue in the hopes that the context you have can provide an answer.
We've noticed a slowdown in our Jest tests after upgrading to
@knapsack-pro/jestv5.4.1 and using theKNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILEoption. What we're seeing is that the execution behavior of batches is very different and not optimized, leading to our Jest steps taking about 9 minutes (up from about 6 minutes). I've tried downgrading just the@knapsack-pro/corelibrary from v4.0.0 to both v3.3.1 and v3.3.0, but did not see any change in behavior. However, reverting back from usingKNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILEtoKNAPSACK_PRO_TEST_FILE_PATTERNis what resolves the problem.Here's a comparison of the two:
KNAPSACK_PRO_TEST_FILE_PATTERN
With this approach, you can see that the batches start with the slowest ones and get faster, leading to better durations when parallelized.
KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE
With this approach, you can see that the batches are not organized and as a result lead to many more batches being executed and durations taking much longer.
I tried to look through the changes, but didn't find an explanation for why the batching behavior would be different between the two approaches so I'm creating this issue in the hopes that the context you have can provide an answer.