Skip to content

Commit

Permalink
Update results with PostCSS 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Sep 15, 2020
1 parent ea73628 commit 6abcc61
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 50 deletions.
66 changes: 42 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Various benchmarks to have feedback about [PostCSS] perfomance.

All results below was runned on node 10.4.1, Fedora 28, Intel Core i7-8550U,
All results below was runned on Node 14.10.1, Fedora 32, Intel Core i7-1065G7,
16 GB RAM and SSD:

[PostCSS]: https://github.com/postcss/postcss
Expand All @@ -13,14 +13,14 @@ All results below was runned on node 10.4.1, Fedora 28, Intel Core i7-8550U,
Compare [CSS processors] for parsings, nested rules, mixins, variables and math:

```
Stylis: 13 ms (2.7 times faster)
PostCSS: 35 ms
Rework: 38 ms (1.1 times slower)
LibSass sync: 82 ms (2.3 times slower)
LibSass: 90 ms (2.5 times slower)
Less: 91 ms (2.6 times slower)
Dart Sass sync: 103 ms (2.9 times slower)
Dart Sass: 169 ms (4.8 times slower)
PostCSS sync: 27 ms (1.1 times faster)
PostCSS: 30 ms
Rework: 33 ms (1.1 times slower)
LibSass sync: 64 ms (2.1 times slower)
LibSass: 66 ms (2.2 times slower)
Dart Sass sync: 77 ms (2.6 times slower)
Dart Sass: 138 ms (4.5 times slower)
Less: 410 ms (13.5 times slower)
```

To get results on your environment:
Expand All @@ -38,17 +38,17 @@ npm test preprocessors
Compare [CSS parsers] written on JS:

```
CSSTree: 5 ms (3.2 times faster)
Stylis: 6 ms (2.8 times faster)
CSSOM: 14 ms (1.3 times faster)
PostCSS: 18 ms
Mensch: 21 ms (1.2 times slower)
Rework: 26 ms (1.5 times slower)
Stylecow: 41 ms (2.3 times slower)
PostCSS Full: 70 ms (3.9 times slower)
Gonzales: 92 ms (5.2 times slower)
Gonzales PE: 94 ms (5.3 times slower)
ParserLib: 96 ms (5.4 times slower)
CSSTree: 4 ms (3.9 times faster)
Stylis: 4 ms (3.5 times faster)
PostCSS: 15 ms
CSSOM: 16 ms (1.1 times slower)
Mensch: 18 ms (1.2 times slower)
Rework: 25 ms (1.7 times slower)
Stylecow: 38 ms (2.6 times slower)
PostCSS Full: 63 ms (4.3 times slower)
Gonzales: 76 ms (5.1 times slower)
ParserLib: 78 ms (5.2 times slower)
Gonzales PE: 88 ms (5.9 times slower)
```

To get results on your environment:
Expand All @@ -66,10 +66,8 @@ npm test parsers
Compare [vendor prefixes tools]:

```
Stylis: 9 ms (4.0 times faster)
Autoprefixer: 34 ms
Stylecow: 157 ms (4.6 times slower)
nib: 176 ms (5.1 times slower)
Autoprefixer: 32 ms
Stylecow: 187 ms (5.9 times slower)
```

To get results on your environment:
Expand All @@ -81,3 +79,23 @@ npm test prefixers
```

[vendor prefixes tools]: https://github.com/postcss/benchmark/blob/master/prefixers.js


## PostCSS APIs

Compare different way to write plugins for PostCSS:

```
Walk sync API 0.60 ops/sec
Visitor sync API 0.79 ops/sec
Walk async API 0.54 ops/sec
Visitor async API 0.63 ops/sec
```

To get results on your environment:

```sh
npm install
bundle install
npm test apis
```
8 changes: 8 additions & 0 deletions apis.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* Results on Node 14.10.1, Fedora 32, Intel Core i7-1065G7, 16 GB RAM, and SSD:
Walk sync API 0.60 ops/sec
Visitor sync API 0.79 ops/sec
Walk async API 0.54 ops/sec
Visitor async API 0.63 ops/sec
*/

let { readFileSync, readFile } = require('fs')
let { promisify } = require('util')
let { join } = require('path')
Expand Down
24 changes: 12 additions & 12 deletions parsers.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/* Results on node 10.4.1, Fedora 28, Intel Core i7-8550U, 16 GB RAM and SSD:
/* Results on Node 14.10.1, Fedora 32, Intel Core i7-1065G7, 16 GB RAM, and SSD:
CSSTree: 5 ms (3.2 times faster)
Stylis: 6 ms (2.8 times faster)
CSSOM: 14 ms (1.3 times faster)
PostCSS: 18 ms
Mensch: 21 ms (1.2 times slower)
Rework: 26 ms (1.5 times slower)
Stylecow: 41 ms (2.3 times slower)
PostCSS Full: 70 ms (3.9 times slower)
Gonzales: 92 ms (5.2 times slower)
Gonzales PE: 94 ms (5.3 times slower)
ParserLib: 96 ms (5.4 times slower)
CSSTree: 4 ms (3.9 times faster)
Stylis: 4 ms (3.5 times faster)
PostCSS: 15 ms
CSSOM: 16 ms (1.1 times slower)
Mensch: 18 ms (1.2 times slower)
Rework: 25 ms (1.7 times slower)
Stylecow: 38 ms (2.6 times slower)
PostCSS Full: 63 ms (4.3 times slower)
Gonzales: 76 ms (5.1 times slower)
ParserLib: 78 ms (5.2 times slower)
Gonzales PE: 88 ms (5.9 times slower)
*/

let { readFileSync, existsSync } = require('fs')
Expand Down
8 changes: 3 additions & 5 deletions prefixers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* Results on node 10.4.1, Fedora 28, Intel Core i7-8550U, 16 GB RAM and SSD:
/* Results on Node 14.10.1, Fedora 32, Intel Core i7-1065G7, 16 GB RAM, and SSD:
Stylis: 9 ms (4.0 times faster)
Autoprefixer: 34 ms
Stylecow: 157 ms (4.6 times slower)
nib: 176 ms (5.1 times slower)
Autoprefixer: 32 ms
Stylecow: 187 ms (5.9 times slower)
*/

let { existsSync, readFileSync } = require('fs')
Expand Down
18 changes: 9 additions & 9 deletions preprocessors.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* Results on node 10.4.1, Fedora 28, Intel Core i7-8550U, 16 GB RAM and SSD:
/* Results on Node 14.10.1, Fedora 32, Intel Core i7-1065G7, 16 GB RAM, and SSD:
Stylis: 13 ms (2.7 times faster)
PostCSS: 35 ms
Rework: 38 ms (1.1 times slower)
LibSass sync: 82 ms (2.3 times slower)
LibSass: 90 ms (2.5 times slower)
Less: 91 ms (2.6 times slower)
Dart Sass sync: 103 ms (2.9 times slower)
Dart Sass: 169 ms (4.8 times slower)
PostCSS sync: 27 ms (1.1 times faster)
PostCSS: 30 ms
Rework: 33 ms (1.1 times slower)
LibSass sync: 64 ms (2.1 times slower)
LibSass: 66 ms (2.2 times slower)
Dart Sass sync: 77 ms (2.6 times slower)
Dart Sass: 138 ms (4.5 times slower)
Less: 410 ms (13.5 times slower)
*/

let { readFileSync, writeFileSync, existsSync } = require('fs')
Expand Down

0 comments on commit 6abcc61

Please sign in to comment.