title: Angularjs $http ajax request slow comparing to Jquery ajax
body: <p>I recently started moving from jQuery to Angularjs. The issue I encountered is that angular $http call is really slow comparing to jquery ajax call. When I'm doing angular's $http requests to my server, I get responses after 1.3s to around 1.7s. But when I do simple </p>
  
  <pre><code>$.ajax({
          type: "POST",
          url: '?lang_page=1'
      })
      .done(function(data) {
      });
  </code></pre>
  
  <p>response times are 200ms to 300ms. I don't see to much on the Chrome Dev Tools CPU Profiler page. From what I tried to debug, it looks like the problem is in $http method, I don't have any watches that could make digest running slowly. Has anyone got similar problems ? Or is it just Angular being super slow ?</p>
  
  <p><strong>Chrome profiler view for the request:</strong>
  <a href="http://i.stack.imgur.com/R2jKx.png" rel="nofollow">http://i.stack.imgur.com/R2jKx.png</a></p>
  
  <p><strong>Chrome profiler view for AJAX response:</strong>
  <a href="http://i.stack.imgur.com/Q8h1u.png" rel="nofollow">http://i.stack.imgur.com/Q8h1u.png</a></p>
  
  <p><strong>main.html:</strong></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;&lt;script data-main="/staticfiles/js/require-patterns.js" 
              src="/staticfiles/js/bower_components/requirejs/require.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;&lt;div ng-controller="PatternsCtrl"&gt;&lt;/div&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>require-patterns.js:</strong></p>
  
  <pre><code>require.config({
      paths: {
          angular: 'bower_components/angular/angular',
          jQuery: 'bower_components/jquery/dist/jquery',
      },
      shim: {
          'angular' : {
              'exports' : 'angular'
          },
          'jQuery': {
              'exports' : '$'
          },
      },
      priority: [
          "angular",
          'jQuery',
     ],
      deps: [],
      callback: null,
      baseUrl: '/staticfiles/js'
  });
  require([
      'angular',
      'jQuery',
      'patterns.module',
      ], function(angular, app, $) {
          var $html = angular.element(document.getElementsByTagName('html')[0]);
          angular.element().ready(function() {
              angular.bootstrap($html, ['myApp']);
          });
      }
  );
  </code></pre>
  
  <p><strong>patterns.module.js:</strong></p>
  
  <pre><code>'use strict';
  define([
      'angular',
      'components/patterns/patternsController'
  ], function(angular, pCtrl) {
      return angular.module('mymod', [
          'mymod.patterns',
      ]);
  });
  </code></pre>
  
  <p><strong>patternsController.js:</strong></p>
  
  <pre><code>'use strict';
  define([
      'angular'
  ], function(angular) {
      return angular.module('mymod.patterns', []).controller('PatternsCtrl', PatternsCtrl);
  
      PatternsCtrl.$inject = ['$http'];
  
      function PatternsCtrl($http) {
          console.log('patterns controler');
          $http({
              method: 'POST',
              url: '?lang_page=1'
          })
          .success(function(data, status) {
          });
      };
  });
  </code></pre>