Skip to content

Commit 5014f2a

Browse files
author
Bart Veneman
committed
add CNN to smoke tests and benchmarks
1 parent f95340a commit 5014f2a

File tree

6 files changed

+153328
-2
lines changed

6 files changed

+153328
-2
lines changed

benchmark/benchmark.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as fs from 'fs'
55
const files = [
66
['bol-com-20190617', 'Bol.com'],
77
['bootstrap-5.0.0', 'Bootstrap 5.0.0'],
8+
['cnn-20220403', 'CNN'],
89
['css-tricks-20190319', 'CSS-Tricks'],
910
['facebook-20190319', 'Facebook.com'],
1011
['github-20210501', 'GitHub.com'],
@@ -26,7 +27,7 @@ files.forEach(([, name]) => {
2627
files.forEach(([filename, name]) => {
2728
const css = fs.readFileSync(`./src/__fixtures__/${filename}.css`, 'utf-8')
2829
const fileSize = byteSize(css.length)
29-
suite.add(`${name.padEnd(maxLen + 2)} (${fileSize.padStart(6)})`, () => analyzeCss(css))
30+
suite.add(`${name.padEnd(maxLen + 2)} (${fileSize.padStart(7)})`, () => analyzeCss(css))
3031
})
3132

3233
console.log('Running benchmark on /dist/analyzer.js:')

benchmark/parse-analyze-ratio.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as fs from 'fs'
44
const files = [
55
['bol-com-20190617', 'Bol.com'],
66
['bootstrap-5.0.0', 'Bootstrap 5.0.0'],
7+
['cnn-20220403', 'CNN'],
78
['css-tricks-20190319', 'CSS-Tricks'],
89
['facebook-20190319', 'Facebook.com'],
910
['github-20210501', 'GitHub.com'],

benchmark/run.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as fs from 'fs'
44
const files = [
55
['bol-com-20190617', 'Bol.com', 117],
66
['bootstrap-5.0.0', 'Bootstrap 5.0.0', 49],
7+
['cnn-20220403', 'CNN', 360],
78
['css-tricks-20190319', 'CSS-Tricks', 50],
89
['facebook-20190319', 'Facebook.com', 71],
910
['github-20210501', 'GitHub.com', 95],
@@ -29,7 +30,7 @@ files.forEach(([filename, name, expectedDuration]) => {
2930
const css = fs.readFileSync(`./src/__fixtures__/${filename}.css`, 'utf-8')
3031
const fileSize = byteSize(css.length)
3132
suite.push([
32-
`${name.padEnd(maxLen + 2)} (${fileSize.padStart(6)})`,
33+
`${name.padEnd(maxLen + 2)} (${fileSize.padStart(7)})`,
3334
() => analyzeCss(css),
3435
expectedDuration
3536
])
@@ -50,3 +51,5 @@ suite.forEach(([name, fn, expectedDuration]) => {
5051
`(${overtime >= 0 ? '-' : '+'}${Math.abs(overtime)}ms ${Math.round(Math.abs(overtime) / duration * 100)}%)`,
5152
)
5253
})
54+
55+
console.log(`Memory used: ${Math.ceil(process.memoryUsage().heapUsed / 1024 / 1024)}MB`)

src/__fixtures__/cnn-20220403.css

Lines changed: 8384 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)