Skip to content

Commit

Permalink
Update prefixer benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Aug 23, 2015
1 parent 469c217 commit e36ecc2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"dependencies": {
"stylecow-plugin-nested-rules": "4.2.2",
"stylecow-plugin-variables": "4.2.0",
"stylecow-plugin-prefixes": "5.0.1",
"stylecow-plugin-calc": "1.2.0",
"postcss-simple-vars": "1.0.0",
"gulp-bench-summary": "0.1.0",
Expand Down
20 changes: 9 additions & 11 deletions prefixers.js
@@ -1,9 +1,9 @@
/* Results on io.js 2.0, Fedora 21, Intel 5Y70, 8 GB RAM and SSD:
/* Results on io.js 2.4, Fedora 21, Intel 5Y70, 8 GB RAM and SSD:
Autoprefixer: 40 ms
Stylecow: 135 ms (3.4 times slower)
nib: 389 ms (9.8 times slower)
Compass: 2364 ms (59.5 times slower)
Autoprefixer: 74 ms
Stylecow: 92 ms (1.2 times slower)
nib: 392 ms (5.3 times slower)
Compass: 2467 ms (33.2 times slower)
*/

var exec = require('child_process').exec;
Expand All @@ -21,8 +21,8 @@ css = postcss([ autoprefixer({ browsers: [] }) ]).process(css).css;
var processor = postcss([ autoprefixer ]);

// Stylecow
var stylecow = require('stylecow');
stylecow.loadPlugin('prefixes');
var stylecow = require('stylecow-core');
stylecow.loadNpmModule('stylecow-plugin-prefixes');

// nib
var stylus = require('stylus');
Expand Down Expand Up @@ -60,10 +60,8 @@ module.exports = {
name: 'Stylecow',
defer: true,
fn: function (done) {
var file = new stylecow.Reader(new stylecow.Tokens(css));
var ast = stylecow.Root.create(file);
stylecow.run(ast);
ast.toString();
var code = stylecow.parse(css);
stylecow.run(code);
done.resolve();
}
},
Expand Down

0 comments on commit e36ecc2

Please sign in to comment.