Stages after $search will consume all the matching documents, and thus $count will take some time. A more performant option is to use when all you want is the count is to use $searchMeta with the count option with no other stages.
$searchMeta
count