Optimise repository scanner (for large folders)