From e36ecc2e799cf42ccd0ee9b3ae9bd8afd4158482 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Mon, 24 Aug 2015 02:12:03 +0300 Subject: [PATCH] Update prefixer benchmark --- package.json | 1 + prefixers.js | 20 +++++++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 5c9612e..c454f14 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/prefixers.js b/prefixers.js index 1621629..5dabc3f 100644 --- a/prefixers.js +++ b/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; @@ -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'); @@ -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(); } },