I'd use:
<file wc -l
Which unlike cat file | wc -l won't run an additional process nor fork two additional subshells (in turn running faster):
% time </tmp/ramdisk/file wc -l     
8000000
wc -l < /tmp/ramdisk/file  0,07s user 0,06s system 97% cpu 0,132 total
% time cat /tmp/ramdisk/file | wc -l
8000000
cat /tmp/ramdisk/file  0,01s user 0,16s system 80% cpu 0,204 total
wc -l  0,09s user 0,10s system 94% cpu 0,203 total
(/tmp/ramdisk/file was stored in a ramdisk to take I/O speed and caching out of the equation.)
For small files the difference would be neglectable.
Yet another way would be:
wc -l file | cut -d' ' -f1
Which in my tests performed approximately the same as <file wc -l, or:
sed -n '$=' file
Which will print the correct number of lines in case the file is missing a trailing newline.