-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Do not merge] Added tracing for application startup #812
Conversation
I've added a startup perf sample app that can repeatedly run On my machine, I've observed these average start times on the basic samples app:
I'll do further testing on real-world apps. |
…d to any DotVVM project
I've updated the startup perf test console app to be a universal .NET tool for measuring startup performance of DotVVM apps. I've tried the performance improvements on two real-world apps (one OWIN, one ASP.NET Core). Both apps are using Entity Framework, AutoMapper, and a complex configuration of IoC/DI which add to the startup time. Still, the improvement is quite visible here.
Also, the assembly handling can have impact on view compilation times - there will be fewer assemblies that would be referenced in the Roslyn compilation when assembly discovery is disabled - right now, all assemblies are in the compiled assembly cache and thus they are referenced in the view compilation. When this is merged in master and combined with #841, we'll see whether the view compilation got faster thanks to the lower number of assemblies DotVVM is dealing with. |
There is still one issue that needs to be addressed - if the user forgets to register an assembly with controls manually, there is no error message, and the application breaks on some places - some DotVVM properties will not get registered and DotVVM will try to treat them as "virtual" properties. This is quite unfortunate and I am not sure where exactly to place the check whether the assembly is registered or not. Also, we need to add the following registrations to our commercial packages: Bootstrap for DotVVM (both versions)
DotVVM Business Pack
DotVVM Dynamic Data
There are also other packages which may need this: Contrib, MiniProfiler, AppInsights, Status Page... |
… DotVVM assembly version
I have added a simple mechanism to trace startup events and send them along with request performance traces.
I thought that the slow startup of DotVVM apps in Azure is caused by
InvokeAllStaticConstructors
that loads all assemblies, but it looks that the slow-down is earlier than this and that it happens inDotvvmStartup.Configure
.This PR doesn't solve the issues, it just gathers timings from the startup code in order to provide a foundation for further analysis.
The results are from
Dotvvm.Samples.BasicSamples.Owin
andDotvvm.Samples.BasicSamples.AspNetCore
.Total
means the number of milliseconds since the app startup (to be precise, from the very first entry into DotVVM code).Duration
represents the number of milliseconds since the previous event.Local - OWIN
Local - ASP.NET Core
Azure App Service - OWIN
Azure App Service - ASP.NET Core