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 9092907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:57:17+00:00 2026-06-16T22:57:17+00:00

Here are the two ways of implementation, that describe the issue. The first one

  • 0

Here are the two ways of implementation, that describe the issue.

The first one is the method that works really slow. It tries to get data from server, but the request is pending too long, only after that it returns data and everything’s fine (except the terrible synchronous perfomance).

asyncMethod: function(doSmth, param) {  
    var resp = $.ajax({
        type: 'GET',
        async: false,
        url: 'url'
    });
    data = resp.responseText;
    doSmth(param, data);
}

Here is the same method, but it’s asynchronous. The perfomance problem is eliminated here. But it executes the part in success only when page is reloaded. Probably reload stops some executions that were the bottleneck of the previous code sample.

asyncMethod: function(doSmth, param) {  
    var resp = $.ajax({
        type: 'GET',
        url: 'url',
        success: function () {
            data = resp.responseText;
            doSmth(param, data);
        }
    });
}

I don’t need to use asynchronous request, if the synchronous one works fast (but now it doesn’t). There seem to be some executions, that make the request remain pending for too long. I don’t see the execution that may be a bottleneck. Maybe it’s somewhere in the libraries that are used, but no other requests are active when resp is being processed.

What are the ways to fix the problem or to analyze it? An advice would be appreciated.

  • 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-16T22:57:19+00:00Added an answer on June 16, 2026 at 10:57 pm

    There are two main culprits if a response is sat on “pending” for too long:

    • The application code that is fulfulling the ajax request is taking longer than expected
    • Simple network latency (not much that can be done about that in the application layer)

    If you have access to the code that is fulfilling the request then I’d start there. Also, it’s probably not a network issue if this request is taking an unusually long time compared to all your other requests

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

Sidebar

Related Questions

Here are two ways to dynamically allocate a multidimensional array that I know: int
How can I make my C# app erase itself (self-destruct)? Here's two ways that
Here are two queries that return the same resultset, but which is the optimal
Here's two screen shots, showing the effect with a small viewport that has to
Here is two variants. First: int n = 42; int* some_function(int* input) { int*
Here is two my variants of method, which returns a string, associated with enum
I have a menu bar that is rotated slightly. Here are two buttons as
Here's my two scenarios. 1 - User opens app for the first time ever
Here are two ways of calling callscript (in pseudocode): using duplicate calls if flag
I have a program that I can run in two ways: single-end or paired-end

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.