创建相同的缩略图,一种方式更慢......为什么?

I'm looking into what is slowing some scripts of mine down. I have got the following scripts, essentially the same, the only difference is one is in a subfolder and uses $_SERVER['DOCUMENT_ROOT'] to get the image url.

Script 1 (C:/xampp/htdocs/ppa/test.php):

<?php
$time_start = microtime(true); 

ini_set("memory_limit", -1);
$im = imagecreatefromjpeg("data/images/20140310/4/test.jpg");

$ratio = 500 / imagesx($im);
$width = 500;
$height = imagesy($im) * $ratio;

//Create thumbnail container
$thumb = imagecreatetruecolor($width,$height);
imagecopyresampled($thumb,$im,0,0,0,0,$width,$height,imagesx($im),imagesy($im));    

$time_end = microtime(true);
$execution_time = "Took ".($time_end - $time_start)/60 ." to generate image";

$white = imagecolorallocate($im,255,255,255);
$font = "images/fonts/Calibri Bold.ttf";

imagettftext($thumb,15,0,20,20,$white,$font,$execution_time);

header("Content-Type: image/jpeg");
imagejpeg($thumb,"thumb.jpg",100);

imagedestroy($im);
?>

Here is the image it produces with the time it took on it: Root Gen

Script 2 (C:/xampp/htdocs/ppa/benchmarking/generate_thumb.php):

<?php
$time_start = microtime(true); 

ini_set("memory_limit", -1);
$im = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT']."/ppa/data/images/20140310/4/test.jpg");

$ratio = 500 / imagesx($im);
$width = 500;
$height = imagesy($im) * $ratio;

//Create thumbnail container
$thumb = imagecreatetruecolor($width,$height);
imagecopyresampled($thumb,$im,0,0,0,0,$width,$height,imagesx($im),imagesy($im));    

$time_end = microtime(true);
$execution_time = "Took ".($time_end - $time_start)/60 ." to generate image";

$white = imagecolorallocate($im,255,255,255);
$font = $_SERVER['DOCUMENT_ROOT']."/ppa/images/fonts/Calibri Bold.ttf";

imagettftext($thumb,15,0,20,20,$white,$font,$execution_time);

header("Content-Type: image/jpeg");
imagejpeg($thumb,"thumb.jpg",100);

imagedestroy($im);
?>

Image it produces:

enter image description here

The times stay similar every time, why is it quicker in the sub directory!? Downsizing from a 1.15MB image (4512x3000)