Adds missing `@import` processing to our benchmark (run via `npm run bench`)
authorGoalSmashers <jakub@goalsmashers.com>
Mon, 28 Oct 2013 07:59:53 +0000 (08:59 +0100)
committerGoalSmashers <jakub@goalsmashers.com>
Mon, 28 Oct 2013 08:02:19 +0000 (09:02 +0100)
History.md
test/bench.js
test/data-bench/_partial.css [new file with mode: 0644]
test/data-bench/complex.css [new file with mode: 0644]

index 2019cd2..3101be1 100644 (file)
@@ -3,6 +3,8 @@
 
 * Adds simplified and more advanced text escaping / restoring via `EscapeStore` class.
 * Adds simplified and much faster empty elements removal.
+* Adds simplified and much faster empty elements removal.
+* Adds missing `@import` processing to our benchmark (run via `npm run bench`).
 
 1.1.6 / 2013-10-26
 ==================
index 8b618d3..aa6afcb 100644 (file)
@@ -1,13 +1,16 @@
 var cleanCSS = require('../index');
-var bigcss = require('fs').readFileSync(require('path').join(__dirname, 'data', 'big.css'), 'utf8');
+var path = require('path');
 
 if (!process.hrtime) {
   console.log('process.hrtime() (node.js > 0.7.6) is required for benchmarking');
   process.exit(1);
 }
 
+var benchDir = path.join(__dirname, 'data-bench');
+var cssData = require('fs').readFileSync(path.join(benchDir, 'complex.css'), 'utf8');
+
 var start = process.hrtime();
-cleanCSS.process(bigcss, { benchmark: true });
+cleanCSS.process(cssData, { benchmark: true, root: benchDir });
 
 var itTook = process.hrtime(start);
 console.log('complete minification: %d ms', 1000 * itTook[0] + itTook[1] / 1000000.0);
diff --git a/test/data-bench/_partial.css b/test/data-bench/_partial.css
new file mode 100644 (file)
index 0000000..f8ce680
--- /dev/null
@@ -0,0 +1 @@
+@import '../data/blueprint.css';
diff --git a/test/data-bench/complex.css b/test/data-bench/complex.css
new file mode 100644 (file)
index 0000000..1e53b24
--- /dev/null
@@ -0,0 +1,4 @@
+@import '../data/reset.css';
+@import '_partial.css';
+@import '../data/960.css';
+@import '../data/big.css';