- Avoid counting elements when it's not needed. - Pass multiple elements to functions instead of calling multiple times.