Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Glimpse shouldn't scan all assemblies for types on startup #981

Open
jtheisen opened this issue Jul 19, 2016 · 3 comments
Open

Glimpse shouldn't scan all assemblies for types on startup #981

jtheisen opened this issue Jul 19, 2016 · 3 comments

Comments

@jtheisen
Copy link

jtheisen commented Jul 19, 2016

Currently, Glimpse contributes about 10s to the warmup time of my app.

This is because the Glimpse module's Init function goes and inspects all types of all assemblies, probably even multiple times.

This has already been discussed years ago in a now closed issue.

The issue was closed because it was anticipated that a version 2 of Glimpse could afford a breaking change in the type location convention.

The workaround suggested by nikmd23 at the time - implementing a custom ServiceLocator - has become more difficult as apparently the types in question are no longer default-contructible as claimed.

I noticed when I tried doing just that.

This issue is years old, there's still no version 2.

I think 10s warmup for Glimpse alone is very problematic, especially when it's unexpected.

Also, when Glimpse is turned off (defaultRuntimePolicy="off"), it still searches the assemblies.

@avanderhoorn
Copy link
Member

In v1, setting defaultRuntimePolicy="off" will still execute the logic on startup. It does this because its looking through other providers that can we at play to see what it should do. Have you tried setting the discoveryLocation to narrow things down?

Put any DLL's that contain Glimpse extensions (like Glimpse.Mvc* or Glimpse.Ef*) in a separate directory inside of bin. Then point the attribute in web.config at the directory. This will reduce the reflection that Glimpse is doing to just the assemblies that actually contain Glimpse extensions.

@jtheisen
Copy link
Author

jtheisen commented Jul 19, 2016

@avanderhoorn Well, yes, but this isn't really a help-desk-type post. I just wanted to remind the relevant people that there's a genuine issue.

So far I'm happy with commenting out Glimpse in development until I need it and never deploy it on production.

@avanderhoorn
Copy link
Member

At the moment in a case like yours I agree with your decision. At the moment 100% of our energy is being put into v2, which will in time hopefully address the specific problem you have. If you would like to submit a PR to fix this issue we can see about pulling it in. If you where interested in this, I would probably look at allowing you to manually specify the types that you want loaded in the web.config the same way that you can specify which types to ignore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants