title: Slow GET request using the Spring controller
body: <p>Here are the two ways of implementation, that describe the issue.</p>
  
  <p>The first one is the method that works really slow. It tries to get data from server, but the request is <code>pending</code> too long, only after that it returns data and everything's fine (except the terrible synchronous perfomance).</p>
  
  <pre><code>asyncMethod: function(doSmth, param) {  
      var resp = $.ajax({
          type: 'GET',
          async: false,
          url: 'url'
      });
      data = resp.responseText;
      doSmth(param, data);
  }
  </code></pre>
  
  <p>Here is the same method, but it's <strong>asynchronous</strong>. 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.</p>
  
  <pre><code>asyncMethod: function(doSmth, param) {  
      var resp = $.ajax({
          type: 'GET',
          url: 'url',
          success: function () {
              data = resp.responseText;
              doSmth(param, data);
          }
      });
  }
  </code></pre>
  
  <p>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 <code>resp</code> is being processed.</p>
  
  <p>What are the ways to fix the problem or to analyze it? An advice would be appreciated.</p>