Skip to content

Commit

Permalink
Add ParseLib parser to benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jul 20, 2016
1 parent 05bcbef commit 8bcc541
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Rework: 47 ms (1.3 times slower)
Stylecow: 74 ms (2.0 times slower)
Gonzales: 113 ms (3.1 times slower)
Gonzales PE: 138 ms (3.8 times slower)
ParserLib: 251 ms (6.8 times slower)
```

To get results on your environment:
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@
"postcss-nested": "1.0.0",
"postcss-mixins": "5.0.0",
"gulp-sequence": "0.4.5",
"stylecow-core": "2.3.0",
"stylecow-core": "2.3.1",
"autoprefixer": "6.3.7",
"postcss-calc": "5.2.1",
"postcss-calc": "5.3.0",
"gonzales-pe": "3.3.6",
"parserlib": "1.0.0",
"gulp-eslint": "3.0.1",
"gulp-bench": "1.1.0",
"gulp-util": "3.0.7",
"node-sass": "3.8.0",
"through2": "2.0.1",
"gonzales": "1.0.7",
"fs-extra": "0.30.0",
"postcss": "5.0.21",
"postcss": "5.1.0",
"mensch": "0.3.1",
"stylus": "0.54.5",
"rework": "1.0.1",
Expand Down
8 changes: 8 additions & 0 deletions parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Rework: 47 ms (1.3 times slower)
Stylecow: 74 ms (2.0 times slower)
Gonzales: 113 ms (3.1 times slower)
Gonzales PE: 138 ms (3.8 times slower)
ParserLib: 251 ms (6.8 times slower)
*/

var path = require('path');
Expand All @@ -21,6 +22,7 @@ var mensch = require('mensch');
var postcss = require('postcss');
var stylecow = require('stylecow-core');
var gonzales = require('gonzales');
var parserlib = require('parserlib');
var gonzalesPe = require('gonzales-pe');

module.exports = {
Expand Down Expand Up @@ -65,6 +67,12 @@ module.exports = {
gonzalesPe.parse(css).toString();
}
},
{
name: 'ParserLib',
fn: function () {
(new parserlib.css.Parser()).parse(css);
}
},
{
name: 'Stylecow',
fn: function () {
Expand Down

0 comments on commit 8bcc541

Please sign in to comment.