title: jquery fetch php data is slow. How to make it fast?
body: <p>As the title describe, the speed of jquery display data is 1 to 2 seconds slower than pure php. Demo at <a href="http://plekz.com/test-slow3.php" rel="nofollow">http://plekz.com/test-slow3.php</a> . How to make jquery display data as fast as pure php?</p>
  
  <p>Codes :</p>
  
  <pre><code>&lt;div id="jqryd"&gt;
  &lt;/div&gt;
  
  &lt;script src="javascripts/jquery-1.5.js" type="text/javascript" language="javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      var jqryd = $('#jqryd');
      jQuery.get("sale-show-month2.php", function(data) {
          jqryd.html(data);
      });
  &lt;/script&gt;
  
  
  &lt;?php
      $sql = "SELECT payment_date, SUM(price) FROM sale WHERE seller_id=? &amp;&amp; Year(payment_date)=? GROUP BY Month(payment_date) DESC"; //this is loged-in user.
      $q = $conn-&gt;prepare($sql);
      $result = $q-&gt;execute(array($user_id, $selected_year));
      if(!$result){
          die("Error Select user table query : ". implode(" : ", $q-&gt;errorInfo())); //if don't use implode, output of errorInfo() will be "Array".
      }
      while($r = $q-&gt;fetch(PDO::FETCH_ASSOC)){
          $price_db2 = $r['SUM(price)'];
          $payment_date_db = $r['payment_date'];
          $payment_month_db = date("F", strtotime($payment_date_db));
          $payment_month_db2 = date("m", strtotime($payment_date_db));
          echo "This is pure php : " . $payment_month_db . " - " . $money_currency . $price_db2 ."&lt;br&gt;";
      }
  ?&gt;
  </code></pre>