system.user.getUser is slow with many Active directory users

I want to check if a username exists in my User source.
I am using the "AD/Database Hybrid" user source.
I first tried to loop through all the users available from "system.user.getUsers", but this was way too slow because we have more than 30000 users in our domain.
I then expected "system.user.getUser" to be faster, but it felt equally slow.
Is there anything else I can try?
Is Ignition reading all the AD users every time I call the getUser command?
Using the LDAP protocol, it should be able to fetch only the users that matches some filter criteria.

Ideally, I would like a fast responding function that returns all usernames that matches a string with wildcards.

Under the hood getUser just loops through the users returned by getUsers, so I'm not surprised they are equally slow. Unfortunately I don't know enough about LDAP to make it better, hopefully someone will chime in on that.

Thank you, very interesting. That means I can not use getUser as it is right now.

I've created a ticket to see if we can improve this. If you want to get updates on it, contact support and tell them it's IGN-8365.