The user profile list attempts to read the object ids prior to reading the actual users which is a good idea if you're fetching users based upon multiple criteria.
When reading user profiles by user id we already know the user ids and can directly pass them to avoid the query since the result is most likely the same.
if (!empty($userIDs)) {
$userList = new UserProfileList();
- $userList->getConditionBuilder()->add("user_table.userID IN (?)", array($userIDs));
+ $userList->setObjectIDs($userIDs);
$userList->readObjects();
foreach ($userList as $user) {