I added a benchmark for the matching; on my computer, matching a filename against (the equivalent of) the list above takes 39 microseconds. So doing that check for 50000 files is about two seconds of CPU time, which would be 40% over a five second window. So yeah, it’s possible that that’s the cause.