Use fd instead. It's a fast alternative to find that traverses folders in parallel. Even after deliberately slowing it with lots of options and purging directory cache between benchmark calls it's still 4-12 times faster than find in my case:
$ time find ~ -type f 2>/dev/null | wc -l
445705
find ~ -type f 2> /dev/null 0.84s user 13.57s system 51% cpu 28.075 total
wc -l 0.03s user 0.02s system 0% cpu 28.074 total
$ time fd -t f -sHI --show-errors . ~ 2>/dev/null | wc -l
445705
fd -t f -sHI --show-errors . ~ 2> /dev/null 2.66s user 14.81s system 628% cpu 2.780 total
wc -l 0.05s user 0.05s system 3% cpu 2.779 total
By default fd skips files in hidden folders or .gitignore, and avoids printing out permission errors so it's even far faster than this. To match the default find options -sHI --show-errors was used.
Of course you'll need to install it as it's not there by default, just like the ffcnt solution above, but installation is trivial in all major platforms. fd is written in Rust so it's also easy to bring a statically built binary around to use in other PCs where it's not available
It's possible to tune this further by printing only a new line instead of piping the whole path. In find you can achieve that with -printf '\n'. This isn't currently supported on fd but it's a feature being requested
Update:
It's now possible to do that with the --format option, until --printf is actually implemented
fd --format '' | wc -l
Note that in Ubuntu due to name clashing you'll need to use fdfind instead of fd. You can just alias fd=fdfind to overcome the longer name
Another nice thing about fd is that when running it in an interactive terminal you'll also get nice colorized texts unlike the output from find. And it's also very appropriate to search in git repos because objects in .git/ won't be searched
Another solution is al-dente. It's very limited in feature, just list all the files, but that's probably one of the reasons that make it fast. You have to compile it from source though as it's not packaged, and you have to specify the number of threads to use. But the result is consistently faster than fd
$ TIMEFORMAT=%R
$ time ./dent ~ $(nproc --all) | wc -l >/dev/null
0.050
$ time fd -sHI --show-errors . ~ 2>/dev/null | wc -l >/dev/null
0.141
$ time find ~ 2>/dev/null | wc -l >/dev/null
0.239