These are some of the scenarios noticed with some customers:
After looking at the profiler trace, we identified that tmBuildTargetDeviceCache and tmGetTargetDeviceCache stored procedures were the main culprits.
tmBuildTargetDeviceCache was taken in some instances up to 220762.7 ms for example.
In this particular case the customer had too many obsolete resource types from previous installations, as well he had too many security groups causing the scoping checks to take too long.
This issue has been resolved in 8.0 HF2 - See release notes for more information DOC9343
This issue has been fixed with our ITMS 8.0 HF2 release.
NOTE: However, attached to this article is a revised version of the stored procedure that will be included in Post-SMP 8.5 RU1 release. This version eliminates scoping based on all possible objects and, instead, reduces the number of items down to just scoped collections only. This suggested change should work for 8.1 RU7, 8.5, and 8.5 RU1
The performance boost should be significant.