Since your lists can only hold strings, I guess you are retrieving the last modification time in each iteration? That would be slow (filesystem + remote ftp). Better to retrieve every date (local + ftp) and save it in an array with a structure for two fields (string name, date lastModification) and just compare those two arrays.