Overall nothing really jumps out at me. I know that forEach can have a slight performance degradation over a standard for loop. I wouldn't expect it to be substantial enough to matter, but maybe nested in a for loop and running over so many lines is causing it to add up...