compare only 10000 entries at each interaction to reduce lock time