dotnet/runtime

Principal.FindByIdentity() method is extremely slow

Open

#34.598 aperta il 6 apr 2020

Vedi su GitHub
 (10 commenti) (0 reazioni) (1 assegnatario)C# (5445 fork)batch import
area-System.DirectoryServiceshelp wantedtenet-performance

Metriche repository

Star
 (17.886 star)
Metriche merge PR
 (Merge medio 12g 11h) (661 PR mergiate in 30 g)

Descrizione

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.

Guida contributor