Skip to content

Commit 4b15b90

Browse files
RobinMalfaitadamwathan
authored andcommitted
add perf utils
1 parent 053ab65 commit 4b15b90

File tree

5 files changed

+109
-0
lines changed

5 files changed

+109
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
index.html
55
package-lock.json
66
yarn-error.log
7+
8+
# Perf related files
9+
isolate*.log

perf/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
output*.css
2+
v8.json

perf/fixture.css

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
@tailwind base;
2+
3+
@tailwind components;
4+
5+
@tailwind utilities;
6+
7+
8+
.btn-1-xl {
9+
@apply sm:space-x-0;
10+
@apply xl:space-x-0;
11+
@apply sm:space-x-1;
12+
@apply xl:space-x-1;
13+
@apply sm:space-y-0;
14+
@apply xl:space-y-0;
15+
@apply sm:space-y-1;
16+
@apply xl:space-y-1;
17+
}
18+
.btn-2-xl {
19+
@apply sm:space-x-0;
20+
@apply xl:space-x-0;
21+
@apply sm:space-x-1;
22+
@apply xl:space-x-1;
23+
@apply sm:space-y-0;
24+
@apply xl:space-y-0;
25+
@apply sm:space-y-1;
26+
@apply xl:space-y-1;
27+
@apply btn-1-xl;
28+
}
29+
.btn-3-xl {
30+
@apply sm:space-x-0;
31+
@apply xl:space-x-0;
32+
@apply sm:space-x-1;
33+
@apply xl:space-x-1;
34+
@apply sm:space-y-0;
35+
@apply xl:space-y-0;
36+
@apply sm:space-y-1;
37+
@apply xl:space-y-1;
38+
@apply btn-2-xl;
39+
}
40+
.btn-4-xl {
41+
@apply sm:space-x-0;
42+
@apply xl:space-x-0;
43+
@apply sm:space-x-1;
44+
@apply xl:space-x-1;
45+
@apply sm:space-y-0;
46+
@apply xl:space-y-0;
47+
@apply sm:space-y-1;
48+
@apply xl:space-y-1;
49+
@apply btn-3-xl;
50+
}
51+
.btn-5-xl {
52+
@apply sm:space-x-0;
53+
@apply xl:space-x-0;
54+
@apply sm:space-x-1;
55+
@apply xl:space-x-1;
56+
@apply sm:space-y-0;
57+
@apply xl:space-y-0;
58+
@apply sm:space-y-1;
59+
@apply xl:space-y-1;
60+
@apply btn-4-xl;
61+
}

perf/script.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Cleanup existing perf stuff
2+
rm isolate-*.log
3+
4+
# Ensure we use the latest build version
5+
npm run babelify
6+
7+
# Run Tailwind on the big fixture file & profile it
8+
node --prof lib/cli.js build ./perf/fixture.css -c ./perf/tailwind.config.js -o ./perf/output.css
9+
10+
# Generate flame graph
11+
node --prof-process --preprocess -j isolate*.log > ./perf/v8.json
12+
13+
# Now visit: https://mapbox.github.io/flamebearer/
14+
# And drag that v8.json file in there!
15+
# You can put "./lib" in the search box which will highlight all our code in green.

perf/tailwind.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
future: 'all',
3+
experimental: 'all',
4+
purge: [],
5+
theme: {
6+
extend: {},
7+
},
8+
variants: [
9+
'responsive',
10+
'motion-safe',
11+
'motion-reduce',
12+
'group-hover',
13+
'group-focus',
14+
'hover',
15+
'focus-within',
16+
'focus-visible',
17+
'focus',
18+
'active',
19+
'visited',
20+
'disabled',
21+
'checked',
22+
'first',
23+
'last',
24+
'odd',
25+
'even',
26+
],
27+
plugins: [],
28+
}

0 commit comments

Comments
 (0)