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

Dale Fraser
  • 4,623
  • 7
  • 39
  • 76
  • 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? – anthonyv Jun 17 '14 at 02:01
  • 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 http://puu.sh/9wYLR/7ee28f3b14.png this code never runs when glimpse isnt on. – Dale Fraser Jun 17 '14 at 02:46
  • Is that hashset/model used by the EF or what ever your data access technology is? – anthonyv Jun 17 '14 at 12:25
  • No that bit of code never gets executed if glimpse isnt running. – Dale Fraser Jun 18 '14 at 00:59
  • Is it used in model biding or as a view model? – anthonyv Jun 18 '14 at 15:18
  • When you say model, do you know your EF/Data model? If so have you enabled any lazy loading on any properties? – anthonyv Jun 25 '14 at 10:58
  • the view is bound to a model and yes it will use lazy loading. But these queries will not run unless glimpse is on – Dale Fraser Jun 26 '14 at 00:02

2 Answers2

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>
anthonyv
  • 2,455
  • 1
  • 14
  • 18
  • 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? – Ben Jul 17 '14 at 09:13
  • 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 1000ms – David De Sloovere Aug 21 '14 at 19:41
  • 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. – anthonyv Sep 22 '14 at 13:37
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>
angularsen
  • 8,160
  • 1
  • 69
  • 83