From 4c9d62be82508f34e5e400d88b943dedf1419ac4 Mon Sep 17 00:00:00 2001
From: Steve Clay
Date: Thu, 4 Sep 2008 01:08:38 +0000
Subject: [PATCH] ab_tests/ : + test for /min (and reran) examples : cleanup -
examples/3 - jquery-1.2.3.js (unneeded duplicate)
---
min_extras/ab_tests/results_summary.txt | 38 +-
min_extras/ab_tests/test_all.bat | 28 +-
min_extras/config.php | 2 +-
min_extras/examples/1/_groupsSources.php | 2 +-
min_extras/examples/1/index.php | 9 +-
min_extras/examples/2/_groupsSources.php | 2 +-
min_extras/examples/2/index.php | 20 +-
min_extras/examples/3/index.php | 37 -
min_extras/examples/3/m.php | 44 -
min_extras/examples/index.php | 3 +
min_extras/examples/jquery-1.2.3.js | 3408 -------------------
min_extras/examples/lib.js | 6 +
min_extras/examples/test space.js | 6 +-
min_extras/unit_tests/test_HTTP_Encoder.php | 2 +-
14 files changed, 78 insertions(+), 3529 deletions(-)
delete mode 100644 min_extras/examples/3/index.php
delete mode 100644 min_extras/examples/3/m.php
create mode 100644 min_extras/examples/index.php
delete mode 100644 min_extras/examples/jquery-1.2.3.js
create mode 100644 min_extras/examples/lib.js
diff --git a/min_extras/ab_tests/results_summary.txt b/min_extras/ab_tests/results_summary.txt
index e54cc51..5437a92 100644
--- a/min_extras/ab_tests/results_summary.txt
+++ b/min_extras/ab_tests/results_summary.txt
@@ -1,28 +1,38 @@
-Document Path: /_3rd_party/minify/web/ab_tests/ideal_php/before.php
+Document Path: /min_extras/ab_tests/ideal_php/before.php
Document Length: 15993 bytes
-Requests per second: 429.53 [#/sec] (mean)
+Requests per second: 415.58 [#/sec] (mean)
--------------------------------------------------------------------------------
-Document Path: /_3rd_party/minify/web/ab_tests/v1.0/minify.php?files=before.js
+Document Path: /min_extras/ab_tests/v1.0/minify.php?files=before.js
Document Length: 54159 bytes
-Requests per second: 299.07 [#/sec] (mean)
+Requests per second: 275.86 [#/sec] (mean)
--------------------------------------------------------------------------------
-Document Path: /_3rd_party/minify/web/ab_tests/minify/test_Files.php
+Document Path: /min_extras/ab_tests/minify/test_Files.php
Document Length: 15993 bytes
-Requests per second: 243.81 [#/sec] (mean)
+ (Connect: 0, Length: 4, Exceptions: 0)
+Requests per second: 239.70 [#/sec] (mean)
--------------------------------------------------------------------------------
-Document Path: /_3rd_party/minify/web/ab_tests/minify/test_Groups.php/test
+Document Path: /min_extras/ab_tests/minify/test_Groups.php/test
Document Length: 15993 bytes
-Requests per second: 225.35 [#/sec] (mean)
+ (Connect: 0, Length: 2, Exceptions: 0)
+Requests per second: 204.15 [#/sec] (mean)
--------------------------------------------------------------------------------
-Document Path: /_3rd_party/minify/web/ab_tests/minify/test_Version1.php?files=before.js
+Document Path: /min_extras/ab_tests/minify/test_Version1.php?files=before.js
Document Length: 15993 bytes
-Requests per second: 234.43 [#/sec] (mean)
+ (Connect: 0, Length: 2, Exceptions: 0)
+Requests per second: 233.58 [#/sec] (mean)
--------------------------------------------------------------------------------
-Document Path: /_3rd_party/minify/web/ab_tests/mod_deflate/before.js
+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
-Requests per second: 189.07 [#/sec] (mean)
+ (Connect: 0, Length: 1, Exceptions: 0)
+Requests per second: 191.04 [#/sec] (mean)
--------------------------------------------------------------------------------
-Document Path: /_3rd_party/minify/web/ab_tests/type-map/before.js.var
+Document Path: /min_extras/ab_tests/type-map/before.js.var
Document Length: 15993 bytes
-Requests per second: 503.94 [#/sec] (mean)
+ (Connect: 0, Length: 1, Exceptions: 0)
+Requests per second: 518.22 [#/sec] (mean)
--------------------------------------------------------------------------------
diff --git a/min_extras/ab_tests/test_all.bat b/min_extras/ab_tests/test_all.bat
index cc31561..45b9962 100644
--- a/min_extras/ab_tests/test_all.bat
+++ b/min_extras/ab_tests/test_all.bat
@@ -1,9 +1,13 @@
@SET PATH=%PATH%;C:\xampp\apache\bin
-::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" http://mc.dev/_3rd_party
+@SET DOMAIN=http://mc.dev
-::SET TXTVIEWER=notepad.exe
+::@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"
+
+@SET ABTESTS=%DOMAIN%/min_extras/ab_tests
+
+::@SET TXTVIEWER=notepad.exe
@SET TXTVIEWER="C:\Program Files\Notepad++\notepad++.exe"
@SET DELIM=TYPE _delimiter
@@ -11,31 +15,35 @@
DEL results.txt
:: baseline PHP
-%ABCALL%/minify/web/ab_tests/ideal_php/before.php >> results.txt
+%ABCALL% %ABTESTS%/ideal_php/before.php >> results.txt
@%DELIM% >> results.txt
:: 1.0 release
-%ABCALL%/minify/web/ab_tests/v1.0/minify.php?files=before.js >> results.txt
+%ABCALL% %ABTESTS%/v1.0/minify.php?files=before.js >> results.txt
@%DELIM% >> results.txt
:: Files controller
-%ABCALL%/minify/web/ab_tests/minify/test_Files.php >> results.txt
+%ABCALL% %ABTESTS%/minify/test_Files.php >> results.txt
@%DELIM% >> results.txt
:: Groups controller
-%ABCALL%/minify/web/ab_tests/minify/test_Groups.php/test >> results.txt
+%ABCALL% %ABTESTS%/minify/test_Groups.php/test >> results.txt
@%DELIM% >> results.txt
:: Version1 controller
-%ABCALL%/minify/web/ab_tests/minify/test_Version1.php?files=before.js >> results.txt
+%ABCALL% %ABTESTS%/minify/test_Version1.php?files=before.js >> results.txt
+@%DELIM% >> results.txt
+
+::/min application
+%ABCALL% %DOMAIN%/min/?f=min_extras/ab_tests/minify/before.js >> results.txt
@%DELIM% >> results.txt
:: mod_deflate
-%ABCALL%/minify/web/ab_tests/mod_deflate/before.js >> results.txt
+%ABCALL% %ABTESTS%/mod_deflate/before.js >> results.txt
@%DELIM% >> results.txt
:: type-map
-%ABCALL%/minify/web/ab_tests/type-map/before.js.var >> results.txt
+%ABCALL% %ABTESTS%/type-map/before.js.var >> results.txt
@%DELIM% >> results.txt
FINDSTR "Path: Length: Requests --" results.txt > results_summary.txt
diff --git a/min_extras/config.php b/min_extras/config.php
index e9ed391..3ad3d55 100644
--- a/min_extras/config.php
+++ b/min_extras/config.php
@@ -13,5 +13,5 @@ ini_set('include_path',
* Set $minifyCachePath to a PHP-writeable path to enable server-side caching
* in all examples and tests.
*/
-$minifyCachePath = 'C:/xampp/tmp'; // '';
+$minifyCachePath = '';
diff --git a/min_extras/examples/1/_groupsSources.php b/min_extras/examples/1/_groupsSources.php
index ae33a03..efb9085 100644
--- a/min_extras/examples/1/_groupsSources.php
+++ b/min_extras/examples/1/_groupsSources.php
@@ -3,7 +3,7 @@
$base = realpath(dirname(__FILE__) . '/..');
$groupsSources = array(
'js' => array(
- "{$base}/jquery-1.2.3.js"
+ "{$base}/lib.js"
,"{$base}/test space.js"
)
,'css' => array("{$base}/test.css")
diff --git a/min_extras/examples/1/index.php b/min_extras/examples/1/index.php
index e3ba2fe..27ae19c 100644
--- a/min_extras/examples/1/index.php
+++ b/min_extras/examples/1/index.php
@@ -18,8 +18,8 @@ $cssBuild = new Minify_Build($groupsSources['css']);
Note: You should always enable caching using
-Minify::useServerCache()
. For the examples this can be set in
-config.php
. Notice that minifying jQuery takes several seconds!.
+Minify::setCache()
. For the examples this can be set in
+config.php
.
Minify Example 1 : Groups controller + Far-off Expires header
@@ -40,7 +40,10 @@ changed in the HTML document, causing the browser to request a new version.
Test client cache
-Reload page (F5 can trigger no-cache headers)
+When you click here to reload the page, your browser should
+not have to re-download the minified files.
+
+example 2 »
-
-
-Note: You should always enable caching using
-Minify::useServerCache()
. For the examples this can be set in
-config.php
. Notice that minifying jQuery takes several seconds!.
-
-
-Minify Example 3: Files controller
-
-This is an example of Minify serving a directory of single css/js files.
-Each file is minified and sent with HTTP encoding (browser-permitting).
-
-Minify tests
-
-
-Test client cache
-Reload page (F5 can trigger no-cache headers)
-
-
-
-
diff --git a/min_extras/examples/2/_groupsSources.php b/min_extras/examples/2/_groupsSources.php
index ae33a03..efb9085 100644
--- a/min_extras/examples/2/_groupsSources.php
+++ b/min_extras/examples/2/_groupsSources.php
@@ -3,7 +3,7 @@
$base = realpath(dirname(__FILE__) . '/..');
$groupsSources = array(
'js' => array(
- "{$base}/jquery-1.2.3.js"
+ "{$base}/lib.js"
,"{$base}/test space.js"
)
,'css' => array("{$base}/test.css")
diff --git a/min_extras/examples/2/index.php b/min_extras/examples/2/index.php
index f4f4f3b..5fdcda5 100644
--- a/min_extras/examples/2/index.php
+++ b/min_extras/examples/2/index.php
@@ -26,8 +26,8 @@ ob_start();
Note: You should always enable caching using
-Minify::useServerCache()
. For the examples this can be set in
-config.php
. Notice that minifying jQuery takes several seconds!.
+Minify::setCache()
. For the examples this can be set in
+config.php
.
Minify Example 2: Minifying Everything
@@ -40,6 +40,9 @@ elements.
As the document is XHTML, Minify_HTML places the 2nd <script>
element in a CDATA section because it contains "<". The output is valid XHTML.
+
+
Minify tests
FAIL PASS
@@ -48,16 +51,21 @@ element in a CDATA section because it contains "<". The output is valid XHTML
Test client cache
-
Reload page (F5 can trigger no-cache headers)
+
When you click here to reload the page, your browser should
+not have to re-download any files.
+
+
extras index »
diff --git a/min_extras/examples/3/index.php b/min_extras/examples/3/index.php
deleted file mode 100644
index 3c047e2..0000000
--- a/min_extras/examples/3/index.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
Minify Example 3
-
-
-
-
-