Slowest: mailq/postqueue -p, because that opens each file.
This would also be unwise given that mailq/postqueue -p can return incomplete results when the number queued files gets large - or more accurately that there is a limit to the amount of data mailq will show and thus it isn't specifically a message count limit.
On Linux systems I use an inotify enabled kernel (>= 2.6.13) and track the events via daemon/db. I then query the daemon when I need counts. You could do similarly on systems that provide an inotify-like feature.
Cheers, Bill