performance: use compare() instead of find()