When you have the auto-hide dock setting enabled there is a very short delay before the dock is hidden. This tweak can be used to remove the delay.
Start a new Terminal session (in Finder click Applications > Utilities > Terminal).
To set this to Disabled, type (or copy and paste) the following command:
defaults write com.apple.Dock autohide-delay -float 0
To reset this setting to the default value, type (or copy and paste) the following command:
defaults delete com.apple.Dock autohide-delay
To activate this tweak immediately, type the following command, or wait until the next reboot:
killall Dock
Close the Terminal session by typing exit
at the prompt.
Disclaimer: Making any changes to your system can cause serious problems that may require you to reinstall your operating system. We cannot guarantee that problems resulting from these modifications can be resolved. Please follow the instructions carefully and use the information provided at your own risk.