dotnet/runtime

Principal.FindByIdentity() method is extremely slow

Open

#34.598 geöffnet am 6. Apr. 2020

Auf GitHub ansehen
 (10 Kommentare) (0 Reaktionen) (1 zugewiesene Person)C# (5.445 Forks)batch import
area-System.DirectoryServiceshelp wantedtenet-performance

Repository-Metriken

Stars
 (17.886 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 12T 11h) (661 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide