Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8103617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:35:46+00:00 2026-06-05T23:35:46+00:00

Bah! I have recently installed the MiniProfiler from http://code.google.com/p/mvc-mini-profiler/ attempting to find all the

  • 0

Bah!

I have recently installed the MiniProfiler from http://code.google.com/p/mvc-mini-profiler/ attempting to find all the slow calls on my site. (There are quite a few. But I’ve fixed a lot of it as a result of the profiler)

There were two common calls that I noticed were being reported by the profiler to take over a second to return in some cases. This didn’t make any sense. The profiler showed the call (in mvc itself) to take around 2-4ms but the overall call took over 1 second. I spent quite a bit of time trying to narrow down the problem.

I noticed that the subsequent ajax calls are always instant but those were on delayed loads and the initial call times seemed to always grow from the initial page load so I decided to check in firebug and IE’s firebug equivalent and the reported times are the same. I decided then to delay the calls made by the page by about 10ms using a setTimeout(). Suddenly the calls are exactly what they should be in terms of how long they take to complete. (Note the actual calls are instant but the reported times aren’t)

I can not figure out why this is happening. I’ve tried to reproduce it using a new project and attempting to duplicate the behavior but alas, all is well in the new project. My initial thoughts were that the initial ajax calls were using the same connection due to the keep alive header, however, all the responses returned with “Closed” on the keep alive so I’m not sure that is the case.

Here are the results from the different services

Mini Profiler

Mini profiler results

Firebug

firebug results

IE’s firebug

ie results

Note that I’m fairly certain the difference between the page results and the first call are a result of the images being loaded for the page.

Javascript Helper function

<script type='text/javascript'>
    function LoadJson(url, callback, error) {
        $.ajax({
            url: url,
            type: "POST",
            dataType: "json",
            success: function (ret) {
                callback(ret);
            },
            error: function (ret) {
                //alert(url);
            }
        });
    }
</script>

Actual call

$(function () {
    LoadJson('/ajax/activeform', function (ret) {
        //Do something
    });
);

Any help in understanding this would be appreciated. Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:35:48+00:00Added an answer on June 5, 2026 at 11:35 pm

    You may be seeing the result of max browser connection to the same domain. Browsers have a certain limit of concurrent connections that they can make to a domain. The reason your delay works is that this allows other requests to finish freeing up a connection allowing your ajax request to action immediately rather than being queued up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have the following code: class Foo(object): bar = 1 def bah(self): print(bar)
Recently when I have been handshaking(oauth flow) with facecbook, when the callback returns google
I have a folder structure like this: /some_folder /tmp /tmp/foo /tmp/foo/fu * /tmp/bar /tmp/bar/bah
I was recently reviewing some code written by two different contractors, both were basic
I have a string like s = title='bah' name='john and jill' purple='haze' none=None i=1
I've got a ListBox (dynamically populated via code): (i can't insert the code, bah)
I have a working excel vba macro that does what I want from here
I have a 3D project based on the EAGLView exemple from Apple. I have
Occasionally I'll have a situation where I've written some code and, based on its
I have a web application (.NET, if it matters) where when one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.