Glimpse making everything 50x slower
Asked Answered
A

2

5

Ive been using glimpse to try to address some slow page issues, only to discover that glimpse is the cause. The page requests are 30000+ seconds, without glimpse they are instant. So I've been chasing ghosts.

How can I use glimpse to see how long everything takes when it is causing such speed differences.

Do I have something configured wrong or is it always this slow

Appellation answered 16/6, 2014 at 23:36 Comment(7)
Is it only on some pages that things are slower? Do those pages use any binary params for sql query? Is the time being taken on the server or the client? Is there any complex/unusual model binding? Are you view models your data models and if so are there any lazy loaded properties?Allude
Debugging this further having glimpse on is resulting in hash's that return tens of thousands of records that slow everything. Without glimpse these hash's aren't created. here is an example puu.sh/9wYLR/7ee28f3b14.png this code never runs when glimpse isnt on.Appellation
Is that hashset/model used by the EF or what ever your data access technology is?Allude
No that bit of code never gets executed if glimpse isnt running.Appellation
Is it used in model biding or as a view model?Allude
When you say model, do you know your EF/Data model? If so have you enabled any lazy loading on any properties?Allude
the view is bound to a model and yes it will use lazy loading. But these queries will not run unless glimpse is onAppellation
A
8

Update your glimpse web.config element to have the following entries:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <tabs>
        <ignoredTypes>
            <add type="Glimpse.Mvc.Tab.ModelBinding, Glimpse.Mvc3" />
            <add type="Glimpse.Mvc.Tab.Metadata, Glimpse.Mvc3" />
        </ignoredTypes>
    </tabs>
    <inspectors>
        <ignoredTypes>
            <add type="Glimpse.Mvc.Inspector.ModelBinderInspector, Glimpse.Mvc3" />
        </ignoredTypes>
    </inspectors>
</glimpse>
Allude answered 30/6, 2014 at 12:3 Comment(3)
This worked for me, I had several lazy loading properties on my view model, one of which was triggering a 2 second database call. with these entries in the web.config it no longer loaded that property. is there any chance you could provide some info as to what this is actually doing?Welkin
I played around with this and you don't need to disable the Metadata tab, that one only make a trivial difference in speed. The ModelBinding however... from 66ms average to 1000msOrellana
Different tabs have different effects. Its important to consider where things are slow. Meaning in the profiling we have done, the slowest part of Glimpse in a typical app is converting the data json for the client - note, this doesn't happen on the origin requests thread. So if you are seeing any issues its worth checking where its coming from.Allude
F
2

Go to /Glimpse.axd and uncheck all the Glimpse addons/tabs. It will give you the XML config needed to copy & paste into your web.config. In my case, it was Routes, probably due to extensive use of attribute routing. Others have mentioned Cache and Metadata, so start by ignoring all, then comment out a few at a time until you find what slows down Glimpse.

Note that the below config may not work for you, if you have different addons or versions installed.

  <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <tabs>
      <ignoredTypes>
<!--        <add type="Glimpse.Ado.Tab.SQL, Glimpse.Ado" />-->
<!--        <add type="Glimpse.AspNet.Tab.Cache, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.AspNet.Tab.Configuration, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.AspNet.Tab.Environment, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.AspNet.Tab.Request, Glimpse.AspNet" />-->
        <add type="Glimpse.AspNet.Tab.Routes, Glimpse.AspNet" />
<!--        <add type="Glimpse.AspNet.Tab.Server, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.AspNet.Tab.Session, Glimpse.AspNet" />-->
<!--        <add type="Glimpse.Core.Tab.Timeline, Glimpse.Core" />-->
<!--        <add type="Glimpse.Core.Tab.Trace, Glimpse.Core" />-->
<!--        <add type="Glimpse.Mvc.Tab.Execution, Glimpse.Mvc5" />-->
<!--        <add type="Glimpse.Mvc.Tab.Metadata, Glimpse.Mvc5" />-->
<!--        <add type="Glimpse.Mvc.Tab.Views, Glimpse.Mvc5" />-->
<!--        <add type="Glimpse.NLog.NLogTab, Glimpse.NLog" /> -->
      </ignoredTypes>
    </tabs>
    <runtimePolicies>
    </runtimePolicies>
  </glimpse>
Freemason answered 27/6, 2015 at 13:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.