This question already has an answer here:
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.