dotnet/runtime

Principal.FindByIdentity() method is extremely slow

Ouverte

#34 598 ouverte le 6 avr. 2020

 (10 commentaires) (0 réaction) (1 personne assignée)C# (5 445 forks)batch import
area-System.DirectoryServiceshelp wantedtenet-performance

Métriques du dépôt

Stars
 (17 886 étoiles)
Métriques de merge PR
 (Merge moyen 12j 11h) (661 PRs mergées en 30 j)

Description

In PowerShell repo we started porting Microsoft.PowerShell.LocalAccounts module to System.DirectoryServices.AccountManagement API (from p/invokes). We had to use workarounds because Principal.FindByIdentity() methods is extremely slow - up to 100x(!) vs Principal.PrincipalSearcher().

On my notebook Get-LocalUser name ported cmdlet takes 2.8 sec(!) vs 25 ms if a workaround is used.

Guide contributeur