There are a lot of calls to `resultsGroupedByFile`, I wonder if some caching wouldn't help here. If the grouping isn't supposed to change, it might help (though I haven't noticed any performance issues so far).