Although the calculation can reliably determine the correct number of tasks, the operation phase ignores these statistics and still loops over every file in the library.
Huge time improvements can be made by logging where all these relevant files are and only operating upon those files in the operation phase.