the yum will search the first package that match the installing if different repo have the same package?
No, it will always check all repositories and use the most recent version of the package that is not broken.
Details of how this is checked depend on your version of yum (you're most probably not using classical yum, but dnf underneath), its configuration, and thus, the actual Linux distro you're using.
For eamcplem in the OS we have repo1/repo2/......repo6, if the package was in the repo6, the install will be slow?
yum always has to check all enabled repositories. Searching for a package of a given name is also not even remotely what takes time - it's the resolving of the dependencies (and thus, checking if things are installable at all), and the actual transaction.