bench-hexo 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +173 -173
  2. package/package.json +21 -9
package/README.md CHANGED
@@ -1,173 +1,173 @@
1
- # bench-hexo
2
-
3
- A benchmarking cli for Hexo, modified from [hexo#benchmark.js](https://github.com/hexojs/hexo/blob/master/test/benchmark.js)
4
-
5
- ## Usage
6
-
7
- ### Profiling
8
-
9
- Use [0x](https://github.com/davidmarkclements/0x) to generate a flamegraph for the Hexo generation process.
10
-
11
- #### Syntax
12
-
13
- ```bash
14
- npx bench-hexo profiling [options]
15
- ```
16
-
17
- #### Options
18
-
19
- - `--max-old-space-size <number>`: Set the maximum old space size for Node.js (default: 4096MB).
20
- - `-c, --concurrency <number>`: Set the number of concurrent processes (default: Infinity).
21
- - `--no-clean`: Do not clean Hexo cache before profiling.
22
-
23
- #### Example
24
-
25
- ```plain
26
- ✔ Cleaning complete.
27
- ✔ Profiling complete. Flamegraph saved to 0x directory.
28
- ✔ Hexo statistics loaded.
29
-
30
- Hexo Statistics:
31
-
32
- Number of posts: 2000
33
- Number of post assets: 0
34
- Avg of post content length: 17330
35
- Number of pages: 0
36
- Number of page assets: 0
37
- Avg of page content length: 0
38
- Number of tags: 100
39
- Number of categories: 13
40
- Number of routes: 4243
41
- ```
42
-
43
- ### Benchmark
44
-
45
- Use perf_hooks to measure the performance metrics of the Hexo generation process.
46
-
47
- #### Syntax
48
-
49
- ```bash
50
- npx bench-hexo benchmark [options]
51
- ```
52
-
53
- #### Options
54
-
55
- - `--max-old-space-size <number>`: Set the maximum old space size for Node.js (default: 4096MB).
56
- - `-c, --concurrency <number>`: Set the number of concurrent processes (default: Infinity).
57
-
58
- #### Example
59
-
60
- ```plain
61
- ✔ Cleaning complete.
62
- Cold processing
63
- ┌──────────────────────────────┬───────────────┐
64
- │ (index) │ Cost time (s) │
65
- ├──────────────────────────────┼───────────────┤
66
- │ Load Plugin/Scripts/Database │ '0.20s' │
67
- │ Process Source │ '2.85s' │
68
- │ Render Posts │ '2.99s' │
69
- │ Render Files │ '7.10s' │
70
- │ Save Database │ '0.64s' │
71
- │ Total time │ '13.77s' │
72
- └──────────────────────────────┴───────────────┘
73
- Hot processing
74
- ┌──────────────────────────────┬───────────────┐
75
- │ (index) │ Cost time (s) │
76
- ├──────────────────────────────┼───────────────┤
77
- │ Load Plugin/Scripts/Database │ '1.17s' │
78
- │ Process Source │ '1.17s' │
79
- │ Render Files │ '6.08s' │
80
- │ Save Database │ '0.64s' │
81
- │ Total time │ '9.06s' │
82
- └──────────────────────────────┴───────────────┘
83
- ✔ Cleaning complete.
84
- Another Cold processing
85
- ┌──────────────────────────────┬───────────────┐
86
- │ (index) │ Cost time (s) │
87
- ├──────────────────────────────┼───────────────┤
88
- │ Load Plugin/Scripts/Database │ '0.20s' │
89
- │ Process Source │ '2.86s' │
90
- │ Render Posts │ '2.95s' │
91
- │ Render Files │ '7.08s' │
92
- │ Save Database │ '0.64s' │
93
- │ Total time │ '13.73s' │
94
- └──────────────────────────────┴───────────────┘
95
- ✔ Hexo statistics loaded.
96
-
97
- Hexo Statistics:
98
-
99
- Number of posts: 2000
100
- Number of post assets: 0
101
- Avg of post content length: 17330
102
- Number of pages: 0
103
- Number of page assets: 0
104
- Avg of page content length: 0
105
- Number of tags: 100
106
- Number of categories: 13
107
- Number of routes: 4243
108
- ```
109
-
110
-
111
- ### Memory
112
-
113
- Use [megumu](https://github.com/D-Sketon/megumu) to measure the memory usage of the Hexo generation process.
114
-
115
- #### Syntax
116
-
117
- ```bash
118
- node src/index.js memory [options]
119
- ```
120
-
121
- #### Options
122
-
123
- - `-s, --sample-rate <number>`: Sample rate in milliseconds (default: 500ms).
124
- - `--max-old-space-size <number>`: Set the maximum old space size for Node.js (default: 4096MB).
125
- - `-c, --concurrency <number>`: Set the number of concurrent processes (default: Infinity).
126
- - `--no-clean`: Do not clean Hexo cache before profiling.
127
-
128
- #### Example
129
-
130
- ```plain
131
- ✔ Cleaning complete.
132
- ✔ Memory profiling complete.
133
- 1196.86┤ ╭╮
134
- 1117.26┤ ││
135
- 1037.66┤ ││
136
- 958.06┤ ││ ╭
137
- 878.46┤ ││ ╭╯
138
- 798.86┤ ││ ╭╯
139
- 719.27┤ ╭╯│ │
140
- 639.67┤ │ ╰─────╯
141
- 560.07┤ ╭╮ │
142
- 480.47┤ │╰──╯
143
- 400.87┼╮ ╭─╯
144
- 321.27┤│ ╭╮╭╯
145
- 241.68┤│ ╭─╯╰╯
146
- 162.08┤╰─╯
147
-
148
-
149
- RSS Memory Stats:
150
-
151
- Avg: 523.54MB
152
- Min: 162.08MB
153
- Max: 1196.86MB
154
- Midian: 483.52MB
155
- Total Time: 12.866s
156
- ✔ Hexo statistics loaded.
157
-
158
- Hexo Statistics:
159
-
160
- Number of posts: 2000
161
- Number of post assets: 0
162
- Avg of post content length: 17330
163
- Number of pages: 0
164
- Number of page assets: 0
165
- Avg of page content length: 0
166
- Number of tags: 100
167
- Number of categories: 13
168
- Number of routes: 4243
169
- ```
170
-
171
- ## License
172
-
173
- MIT
1
+ # bench-hexo
2
+
3
+ A benchmarking cli for Hexo, modified from [hexo#benchmark.js](https://github.com/hexojs/hexo/blob/master/test/benchmark.js)
4
+
5
+ ## Usage
6
+
7
+ ### Profiling
8
+
9
+ Use [0x](https://github.com/davidmarkclements/0x) to generate a flamegraph for the Hexo generation process.
10
+
11
+ #### Syntax
12
+
13
+ ```bash
14
+ npx bench-hexo profiling [options]
15
+ ```
16
+
17
+ #### Options
18
+
19
+ - `--max-old-space-size <number>`: Set the maximum old space size for Node.js (default: 4096MB).
20
+ - `-c, --concurrency <number>`: Set the number of concurrent processes (default: Infinity).
21
+ - `--no-clean`: Do not clean Hexo cache before profiling.
22
+
23
+ #### Example
24
+
25
+ ```plain
26
+ ✔ Cleaning complete.
27
+ ✔ Profiling complete. Flamegraph saved to 0x directory.
28
+ ✔ Hexo statistics loaded.
29
+
30
+ Hexo Statistics:
31
+
32
+ Number of posts: 2000
33
+ Number of post assets: 0
34
+ Avg of post content length: 17330
35
+ Number of pages: 0
36
+ Number of page assets: 0
37
+ Avg of page content length: 0
38
+ Number of tags: 100
39
+ Number of categories: 13
40
+ Number of routes: 4243
41
+ ```
42
+
43
+ ### Benchmark
44
+
45
+ Use perf_hooks to measure the performance metrics of the Hexo generation process.
46
+
47
+ #### Syntax
48
+
49
+ ```bash
50
+ npx bench-hexo benchmark [options]
51
+ ```
52
+
53
+ #### Options
54
+
55
+ - `--max-old-space-size <number>`: Set the maximum old space size for Node.js (default: 4096MB).
56
+ - `-c, --concurrency <number>`: Set the number of concurrent processes (default: Infinity).
57
+
58
+ #### Example
59
+
60
+ ```plain
61
+ ✔ Cleaning complete.
62
+ Cold processing
63
+ ┌──────────────────────────────┬───────────────┐
64
+ │ (index) │ Cost time (s) │
65
+ ├──────────────────────────────┼───────────────┤
66
+ │ Load Plugin/Scripts/Database │ '0.20s' │
67
+ │ Process Source │ '2.85s' │
68
+ │ Render Posts │ '2.99s' │
69
+ │ Render Files │ '7.10s' │
70
+ │ Save Database │ '0.64s' │
71
+ │ Total time │ '13.77s' │
72
+ └──────────────────────────────┴───────────────┘
73
+ Hot processing
74
+ ┌──────────────────────────────┬───────────────┐
75
+ │ (index) │ Cost time (s) │
76
+ ├──────────────────────────────┼───────────────┤
77
+ │ Load Plugin/Scripts/Database │ '1.17s' │
78
+ │ Process Source │ '1.17s' │
79
+ │ Render Files │ '6.08s' │
80
+ │ Save Database │ '0.64s' │
81
+ │ Total time │ '9.06s' │
82
+ └──────────────────────────────┴───────────────┘
83
+ ✔ Cleaning complete.
84
+ Another Cold processing
85
+ ┌──────────────────────────────┬───────────────┐
86
+ │ (index) │ Cost time (s) │
87
+ ├──────────────────────────────┼───────────────┤
88
+ │ Load Plugin/Scripts/Database │ '0.20s' │
89
+ │ Process Source │ '2.86s' │
90
+ │ Render Posts │ '2.95s' │
91
+ │ Render Files │ '7.08s' │
92
+ │ Save Database │ '0.64s' │
93
+ │ Total time │ '13.73s' │
94
+ └──────────────────────────────┴───────────────┘
95
+ ✔ Hexo statistics loaded.
96
+
97
+ Hexo Statistics:
98
+
99
+ Number of posts: 2000
100
+ Number of post assets: 0
101
+ Avg of post content length: 17330
102
+ Number of pages: 0
103
+ Number of page assets: 0
104
+ Avg of page content length: 0
105
+ Number of tags: 100
106
+ Number of categories: 13
107
+ Number of routes: 4243
108
+ ```
109
+
110
+
111
+ ### Memory
112
+
113
+ Use [megumu](https://github.com/D-Sketon/megumu) to measure the memory usage of the Hexo generation process.
114
+
115
+ #### Syntax
116
+
117
+ ```bash
118
+ npx bench-hexo memory [options]
119
+ ```
120
+
121
+ #### Options
122
+
123
+ - `-s, --sample-rate <number>`: Sample rate in milliseconds (default: 500ms).
124
+ - `--max-old-space-size <number>`: Set the maximum old space size for Node.js (default: 4096MB).
125
+ - `-c, --concurrency <number>`: Set the number of concurrent processes (default: Infinity).
126
+ - `--no-clean`: Do not clean Hexo cache before profiling.
127
+
128
+ #### Example
129
+
130
+ ```plain
131
+ ✔ Cleaning complete.
132
+ ✔ Memory profiling complete.
133
+ 1196.86┤ ╭╮
134
+ 1117.26┤ ││
135
+ 1037.66┤ ││
136
+ 958.06┤ ││ ╭
137
+ 878.46┤ ││ ╭╯
138
+ 798.86┤ ││ ╭╯
139
+ 719.27┤ ╭╯│ │
140
+ 639.67┤ │ ╰─────╯
141
+ 560.07┤ ╭╮ │
142
+ 480.47┤ │╰──╯
143
+ 400.87┼╮ ╭─╯
144
+ 321.27┤│ ╭╮╭╯
145
+ 241.68┤│ ╭─╯╰╯
146
+ 162.08┤╰─╯
147
+
148
+
149
+ RSS Memory Stats:
150
+
151
+ Avg: 523.54MB
152
+ Min: 162.08MB
153
+ Max: 1196.86MB
154
+ Midian: 483.52MB
155
+ Total Time: 12.866s
156
+ ✔ Hexo statistics loaded.
157
+
158
+ Hexo Statistics:
159
+
160
+ Number of posts: 2000
161
+ Number of post assets: 0
162
+ Avg of post content length: 17330
163
+ Number of pages: 0
164
+ Number of page assets: 0
165
+ Avg of page content length: 0
166
+ Number of tags: 100
167
+ Number of categories: 13
168
+ Number of routes: 4243
169
+ ```
170
+
171
+ ## License
172
+
173
+ MIT
package/package.json CHANGED
@@ -1,28 +1,35 @@
1
1
  {
2
2
  "name": "bench-hexo",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "bin": {
5
5
  "bench-hexo": "dist/index.js"
6
6
  },
7
- "scripts": {
8
- "build": "tsc"
9
- },
10
7
  "files": [
11
8
  "dist"
12
9
  ],
10
+ "engines": {
11
+ "node": ">=18"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc"
15
+ },
13
16
  "author": "D-Sketon",
14
17
  "license": "MIT",
15
18
  "description": "A benchmarking cli for Hexo.",
19
+ "publishConfig": {
20
+ "provenance": true,
21
+ "access": "public"
22
+ },
16
23
  "devDependencies": {
17
- "@types/node": "^22.13.13",
18
- "typescript": "^5.8.2"
24
+ "@types/node": "^26.1.1",
25
+ "typescript": "^5.9.2"
19
26
  },
20
27
  "dependencies": {
21
28
  "0x": "^5.8.0",
22
29
  "asciichart": "^1.5.25",
23
30
  "commander": "^13.1.0",
24
- "fast-text-table": "^0.1.0",
25
- "megumu": "^0.1.0",
31
+ "fast-text-table": "^1.0.1",
32
+ "megumu": "^0.1.2",
26
33
  "ora": "^5.4.1"
27
34
  },
28
35
  "peerDependencies": {
@@ -35,5 +42,10 @@
35
42
  "bugs": {
36
43
  "url": "https://github.com/D-Sketon/bench-hexo/issues"
37
44
  },
38
- "homepage": "https://github.com/D-Sketon/bench-hexo#readme"
45
+ "homepage": "https://github.com/D-Sketon/bench-hexo#readme",
46
+ "keywords": [
47
+ "hexo",
48
+ "benchmark",
49
+ "cli"
50
+ ]
39
51
  }