The script is already using the Get-View cmdlet, which is on average faster.
A next step could be to limit the number of properties that should be present in the returned objects, that will also lower the execution time.
Get-View-id$_.Runtime.Host
Get-View-id$_.Runtime.Host -PropertyName
A preliminary test showed that the 2nd line is 55% faster than the first one.
You will to verify of course that all the required properties you use later on are present.