title: XAMPP on Win7 too slow
body: <p>I'm running XAMPP 1.7.1 on Windows 7 Ultimate. Everything (Apache &amp; MySQL) is working fine except for speed.</p>
  
  <p>When I open <a href="http://localhost/" rel="noreferrer">http://localhost/</a>, I must wait probably 1-3 seconds for view a webpage. In my opinion, it should be at most some hundreds miliseconds.</p>
  
  <p>Basic facts:</p>
  
  <ul>
  <li>while waiting to load a localhost webpage, status bar says "Waiting for localhost..."</li>
  <li>CPU is still idle (no increased activity while loading)</li>
  <li>on localhost is no demanding PHP scripts, problems are when there is simple phpinfo() even if there is long heavy scripts.</li>
  <li>disabling MySQL server don't affect speed</li>
  <li>my PC: AMD Turion 64 X2; 1,6 GHz dual-core, 2 GB RAM, 100 GB HDD</li>
  </ul>
  
  <p>I've made a little simple benchmark PHP script to test HDD/CSS speeds:</p>
  
  <pre><code>&lt;?php
  
  function getmicrotime() { 
      list($usec, $sec) = explode(" ", microtime());
      return ((float)$usec + (float)$sec);
  }
  
  function testReadWrite() {
   $timeStart = getmicrotime();
   $filename = "test.txt";
  
   file_put_contents( $filename, '' ); // prepare empty file
  
   for ( $i = 0; $i &lt; 1000; $i++ ) {
    $a = file_get_contents( $filename );
    file_put_contents( $filename, $a . '.' );
   }
  
   return round( getmicrotime() - $timeStart, 3 );
  } 
  
  
  function testCpuSpeed() {
   $timeStart = getmicrotime();
  
   $var = '';
   for ( $i = 0; $i &lt; 100000; $i++ ) {
    $var = sha1( md5( $i * $i * $i * $i * $i * $i * $i * $i * $i * $i ) );
   }
  
   return round( getmicrotime() - $timeStart, 3 );
  }
  
  echo "Read/write #1: " . testReadWrite() . "&lt;BR&gt;";
  echo "Read/write #2: " . testReadWrite() . "&lt;BR&gt;";
  echo "Read/write #3: " . testReadWrite() . "&lt;BR&gt;";
  echo "CPU speed #1: " . testCpuSpeed() . "&lt;BR&gt;";
  echo "CPU speed #2: " . testCpuSpeed() . "&lt;BR&gt;";
  echo "CPU speed #3: " . testCpuSpeed() . "&lt;BR&gt;";
  
  ?&gt;
  </code></pre>
  
  <p>My PC results:</p>
  
  <ul>
  <li>Read/write: 5.134 / 3.431 / 3.494 </li>
  <li>CPU speed: 0.816 / 0.767 / 0.795</li>
  </ul>
  
  <p>A webhosting results:</p>
  
  <ul>
  <li>Read/write: 7.768 / 7.69 / 7.371</li>
  <li>CPU speed: 0.232 / 0.234 / 0.234</li>
  </ul>
  
  <p>One of my server's results (as idle computer nearly as my PC, but a little bit faster):</p>
  
  <ul>
  <li>Read/write: 0.088 / 0.168 / 0.185</li>
  <li>CPU speed: 0.191 / 0.189 / 0.189</li>
  </ul>
  
  <p>So I don't think that it is because of my PC speed, but I'm sure that there's some another problem.
  Do you have some experience with XAMPP speed on Windows 7 (or Vista) ?</p>
  
  <p>Thanks.</p>