Is there a better way to check for a new comment?

This is the most efficient way to count comments. That line of code can be simplified by using the get_comments_number template tag. Both of them simplify down to a simple SQL query that queries for “count”. MySQL is highly optimized to count these records without scanning all of them.