diff --git a/min_extras/ab_tests/minify/test_Files.php b/min_extras/ab_tests/minify/test_Files.php index 74718f0..f9cae9c 100644 --- a/min_extras/ab_tests/minify/test_Files.php +++ b/min_extras/ab_tests/minify/test_Files.php @@ -11,5 +11,5 @@ Minify::serve('Files', array( 'files' => array( dirname(__FILE__) . '/before.js' ) - ,'setExpires' => $_SERVER['REQUEST_TIME'] + 31536000 // 1 yr + ,'maxAge' => 31536000 // 1 yr )); diff --git a/min_extras/ab_tests/minify/test_Files_Memcache.php b/min_extras/ab_tests/minify/test_Files_Memcache.php new file mode 100644 index 0000000..59abcd1 --- /dev/null +++ b/min_extras/ab_tests/minify/test_Files_Memcache.php @@ -0,0 +1,19 @@ +connect('localhost', 11211)) { + die(); +} +Minify::setCache(new Minify_Cache_Memcache($mc)); + +Minify::serve('Files', array( + 'files' => array( + dirname(__FILE__) . '/before.js' + ) + ,'maxAge' => 31536000 // 1 yr +)); diff --git a/min_extras/ab_tests/minify/test_Groups.php b/min_extras/ab_tests/minify/test_Groups.php index a70bc94..cdeccc0 100644 --- a/min_extras/ab_tests/minify/test_Groups.php +++ b/min_extras/ab_tests/minify/test_Groups.php @@ -11,5 +11,5 @@ Minify::serve('Groups', array( 'groups' => array( 'test' => array(dirname(__FILE__) . '/before.js') ) - ,'setExpires' => $_SERVER['REQUEST_TIME'] + 31536000 // 1 yr + ,'maxAge' => 31536000 // 1 yr )); diff --git a/min_extras/ab_tests/results_summary.txt b/min_extras/ab_tests/results_summary.txt index 5437a92..88a0cec 100644 --- a/min_extras/ab_tests/results_summary.txt +++ b/min_extras/ab_tests/results_summary.txt @@ -1,38 +1,9 @@ -Document Path: /min_extras/ab_tests/ideal_php/before.php -Document Length: 15993 bytes -Requests per second: 415.58 [#/sec] (mean) --------------------------------------------------------------------------------- -Document Path: /min_extras/ab_tests/v1.0/minify.php?files=before.js -Document Length: 54159 bytes -Requests per second: 275.86 [#/sec] (mean) --------------------------------------------------------------------------------- Document Path: /min_extras/ab_tests/minify/test_Files.php Document Length: 15993 bytes - (Connect: 0, Length: 4, Exceptions: 0) -Requests per second: 239.70 [#/sec] (mean) +Requests per second: 248.06 [#/sec] (mean) -------------------------------------------------------------------------------- -Document Path: /min_extras/ab_tests/minify/test_Groups.php/test +Document Path: /min_extras/ab_tests/minify/test_Files_Memcache.php Document Length: 15993 bytes - (Connect: 0, Length: 2, Exceptions: 0) -Requests per second: 204.15 [#/sec] (mean) --------------------------------------------------------------------------------- -Document Path: /min_extras/ab_tests/minify/test_Version1.php?files=before.js -Document Length: 15993 bytes - (Connect: 0, Length: 2, Exceptions: 0) -Requests per second: 233.58 [#/sec] (mean) --------------------------------------------------------------------------------- -Document Path: /min/?f=min_extras/ab_tests/minify/before.js -Document Length: 15993 bytes - (Connect: 0, Length: 1, Exceptions: 0) -Requests per second: 246.63 [#/sec] (mean) --------------------------------------------------------------------------------- -Document Path: /min_extras/ab_tests/mod_deflate/before.js -Document Length: 16053 bytes - (Connect: 0, Length: 1, Exceptions: 0) -Requests per second: 191.04 [#/sec] (mean) --------------------------------------------------------------------------------- -Document Path: /min_extras/ab_tests/type-map/before.js.var -Document Length: 15993 bytes - (Connect: 0, Length: 1, Exceptions: 0) -Requests per second: 518.22 [#/sec] (mean) + (Connect: 0, Length: 17, Exceptions: 0) +Requests per second: 181.56 [#/sec] (mean) -------------------------------------------------------------------------------- diff --git a/min_extras/ab_tests/test_all.bat b/min_extras/ab_tests/test_all.bat index 45b9962..3095d78 100644 --- a/min_extras/ab_tests/test_all.bat +++ b/min_extras/ab_tests/test_all.bat @@ -2,8 +2,9 @@ @SET DOMAIN=http://mc.dev -::@SET ABCALL=ab -d -S -c 100 -n 2000 -H "Accept-Encoding: deflate, gzip" http://localhost @SET ABCALL=ab -d -S -c 100 -n 2000 -H "Accept-Encoding: deflate, gzip" +:: for priming cache +@SET ABPRIM=ab -d -S -c 1 -n 2 -H "Accept-Encoding: deflate, gzip" @SET ABTESTS=%DOMAIN%/min_extras/ab_tests @@ -14,6 +15,17 @@ DEL results.txt +:: prime caches (though some may not need it) +%ABPRIM% %ABTESTS%/ideal_php/before.php +%ABPRIM% %ABTESTS%/v1.0/minify.php?files=before.js +%ABPRIM% %ABTESTS%/minify/test_Files.php +%ABPRIM% %ABTESTS%/minify/test_Files_Memcache.php +%ABPRIM% %ABTESTS%/minify/test_Groups.php/test +%ABPRIM% %ABTESTS%/minify/test_Version1.php?files=before.js +%ABPRIM% %DOMAIN%/min/?f=min_extras/ab_tests/minify/before.js +%ABPRIM% %ABTESTS%/mod_deflate/before.js +%ABPRIM% %ABTESTS%/type-map/before.js.var + :: baseline PHP %ABCALL% %ABTESTS%/ideal_php/before.php >> results.txt @%DELIM% >> results.txt @@ -26,6 +38,10 @@ DEL results.txt %ABCALL% %ABTESTS%/minify/test_Files.php >> results.txt @%DELIM% >> results.txt +:: Files controller w/ Memcache as cache +%ABCALL% %ABTESTS%/minify/test_Files_Memcache.php >> results.txt +@%DELIM% >> results.txt + :: Groups controller %ABCALL% %ABTESTS%/minify/test_Groups.php/test >> results.txt @%DELIM% >> results.txt diff --git a/min_extras/ab_tests/test_memcache.bat b/min_extras/ab_tests/test_memcache.bat new file mode 100644 index 0000000..ba664fb --- /dev/null +++ b/min_extras/ab_tests/test_memcache.bat @@ -0,0 +1,13 @@ +@SET PATH=%PATH%;C:\xampp\apache\bin + +@SET DOMAIN=http://mc.dev + +@SET ABTESTS=%DOMAIN%/min_extras/ab_tests + +ab -d -S -c 1 -n 2 -H "Accept-Encoding: deflate, gzip" %ABTESTS%/minify/test_Files_Memcache.php + +DEL results.txt + +ab -d -S -c 100 -n 1000 -H "Accept-Encoding: deflate, gzip" %ABTESTS%/minify/test_Files_Memcache.php >> results.txt + +START "C:\Program Files\Notepad++\notepad++.exe" results.txt \ No newline at end of file