WebApplication.CreateBuilder potentially inefficient, results in many file system checks #32432
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
feature-minimal-hosting
Perf
Milestone
While debugging through #32415 I noticed that the call to
WebApplicaiton.CreateBuilder(args)
results in nine calls toWebHostEnvironment.ResolveFileProviders()
, which in turn does multiple file system checks viaDirectory.Exists
and creates new instances ofPhysicalFileProvider
.This seems inefficient and will potentially impact startup time on systems with slower drives (spinning rust, cloud-mapped drives, etc.) or with AV running. We should investigate whether this can be optimized.
@halter73 @davidfowl
The text was updated successfully, but these errors were encountered: