I was looking for a file in my source and tried both locate and find. Surprisingly locate was searching in entire machine and was faster than find, which was searching only in current directory and sub directories.
Here are my shell commands for both:
find . -name vendorsetup.sh # takes 50 seconds to search all files in curren -sub directories.
locate vendorsetup.sh # takes 20 seconds to search file in whole machine.
Why this?
time locate nonexisting_file locate nonexisting_file 1.46s user 0.01s system 99% cpu 1.483 total