Light performance improvement for testing the size of each file