koa-classic-server 3.0.1 → 3.1.0

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 (106) hide show
  1. package/README.md +44 -120
  2. package/index.cjs +200 -21
  3. package/package.json +10 -5
  4. package/.github/workflows/npm-publish.yml +0 -98
  5. package/CLAUDE.md +0 -101
  6. package/__tests__/benchmark-results-baseline-v1.2.0.txt +0 -354
  7. package/__tests__/benchmark-results-optimized-v2.0.0.txt +0 -354
  8. package/__tests__/benchmark-results-v3.0.0.txt +0 -372
  9. package/__tests__/benchmark.js +0 -239
  10. package/__tests__/caching-headers.test.js +0 -556
  11. package/__tests__/compression-fixtures/data.json +0 -1
  12. package/__tests__/compression-fixtures/large.txt +0 -1
  13. package/__tests__/compression-fixtures/small.txt +0 -1
  14. package/__tests__/compression.test.js +0 -284
  15. package/__tests__/customTest/README.md +0 -6
  16. package/__tests__/customTest/loadConfig.util.js +0 -41
  17. package/__tests__/customTest/serversToLoad.util.js +0 -93
  18. package/__tests__/demo-regex-index.js +0 -140
  19. package/__tests__/deprecation-warnings.test.js +0 -105
  20. package/__tests__/directory-sorting-links.test.js +0 -135
  21. package/__tests__/dt-unknown.test.js +0 -635
  22. package/__tests__/ejs.test.js +0 -299
  23. package/__tests__/head-method.test.js +0 -160
  24. package/__tests__/hidden-fixtures/.dot-dir/inside.txt +0 -1
  25. package/__tests__/hidden-fixtures/.env +0 -2
  26. package/__tests__/hidden-fixtures/.well-known/acme-challenge.txt +0 -1
  27. package/__tests__/hidden-fixtures/config/secrets/password.txt +0 -1
  28. package/__tests__/hidden-fixtures/data.key +0 -1
  29. package/__tests__/hidden-fixtures/file.secret +0 -1
  30. package/__tests__/hidden-fixtures/index.html +0 -1
  31. package/__tests__/hidden-fixtures/normal.txt +0 -1
  32. package/__tests__/hidden-fixtures/subdir/.env +0 -1
  33. package/__tests__/hidden-fixtures/subdir/regular.txt +0 -1
  34. package/__tests__/hidden-option.test.js +0 -407
  35. package/__tests__/hideExtension.test.js +0 -607
  36. package/__tests__/index-option.test.js +0 -449
  37. package/__tests__/index.test.js +0 -345
  38. package/__tests__/listing.test.js +0 -437
  39. package/__tests__/logger.test.js +0 -232
  40. package/__tests__/performance.test.js +0 -370
  41. package/__tests__/publicWwwTest/cartella/sottocartella/ciao.html +0 -11
  42. package/__tests__/publicWwwTest/cartella/sottocartella/provaEjs/testEjs.ejs +0 -11
  43. package/__tests__/publicWwwTest/cartella vuota con spazi nel nome/file con spazio nel nome .txt +0 -1
  44. package/__tests__/publicWwwTest/cartella vuota con spazi nel nome /file con spazio nel nome .txt +0 -1
  45. package/__tests__/publicWwwTest/ejs-templates/complex.ejs +0 -56
  46. package/__tests__/publicWwwTest/ejs-templates/index.ejs +0 -30
  47. package/__tests__/publicWwwTest/ejs-templates/simple.ejs +0 -13
  48. package/__tests__/publicWwwTest/ejs-templates/with-conditional.ejs +0 -28
  49. package/__tests__/publicWwwTest/ejs-templates/with-escaping.ejs +0 -26
  50. package/__tests__/publicWwwTest/ejs-templates/with-loop.ejs +0 -16
  51. package/__tests__/publicWwwTest/hideext-test/about/index.html +0 -1
  52. package/__tests__/publicWwwTest/hideext-test/about.EJS +0 -1
  53. package/__tests__/publicWwwTest/hideext-test/about.ejs +0 -2
  54. package/__tests__/publicWwwTest/hideext-test/blog/articolo.ejs +0 -2
  55. package/__tests__/publicWwwTest/hideext-test/conflict-test/pagina +0 -1
  56. package/__tests__/publicWwwTest/hideext-test/conflict-test/pagina.ejs +0 -1
  57. package/__tests__/publicWwwTest/hideext-test/file.ejs.bak +0 -1
  58. package/__tests__/publicWwwTest/hideext-test/index.ejs +0 -2
  59. package/__tests__/publicWwwTest/hideext-test/photo.txt +0 -1
  60. package/__tests__/publicWwwTest/hideext-test/sezione/index.ejs +0 -1
  61. package/__tests__/publicWwwTest/hideext-test/style.css +0 -1
  62. package/__tests__/publicWwwTest/ile_vuoto.txt +0 -0
  63. package/__tests__/publicWwwTest/index.html +0 -11
  64. package/__tests__/publicWwwTest/prova file .txt +0 -2
  65. package/__tests__/publicWwwTest/semplicetxt.txt +0 -1
  66. package/__tests__/publicWwwTest/test-page.html +0 -1
  67. package/__tests__/publicWwwTest/test.txt +0 -1
  68. package/__tests__/range-fixtures/sample.txt +0 -1
  69. package/__tests__/range.test.js +0 -223
  70. package/__tests__/security-headers.test.js +0 -165
  71. package/__tests__/security.test.js +0 -322
  72. package/__tests__/server-cache-fixtures/large.txt +0 -1
  73. package/__tests__/server-cache-fixtures/small.txt +0 -1
  74. package/__tests__/server-cache.test.js +0 -594
  75. package/__tests__/setup-benchmark.js +0 -178
  76. package/__tests__/symlink.test.js +0 -441
  77. package/__tests__/template-timeout.test.js +0 -321
  78. package/__tests__/test-regex-quick.js +0 -158
  79. package/__tests__/useOriginalUrl.test.js +0 -213
  80. package/docs/ACTION_PLAN.md +0 -293
  81. package/docs/BENCHMARKS.md +0 -317
  82. package/docs/CHANGELOG.md +0 -906
  83. package/docs/CODE_REVIEW.md +0 -300
  84. package/docs/DEBUG_REPORT.md +0 -593
  85. package/docs/DOCUMENTATION.md +0 -1864
  86. package/docs/EXAMPLES_INDEX_OPTION.md +0 -395
  87. package/docs/FLOW_DIAGRAM.md +0 -954
  88. package/docs/INDEX_OPTION_PRIORITY.md +0 -527
  89. package/docs/OPTIMIZATION_HTTP_CACHING.md +0 -689
  90. package/docs/OPTIMIZATION_ROADMAP_for_V3.md +0 -864
  91. package/docs/PERFORMANCE_ANALYSIS.md +0 -839
  92. package/docs/PERFORMANCE_COMPARISON.md +0 -388
  93. package/docs/noteExports.md +0 -148
  94. package/docs/security_improvement_for_V3.md +0 -421
  95. package/docs/template-engine/TEMPLATE_ENGINE_GUIDE.md +0 -1734
  96. package/docs/template-engine/esempi-incrementali.js +0 -192
  97. package/docs/template-engine/examples/esempio1-nessun-dato.ejs +0 -12
  98. package/docs/template-engine/examples/esempio2-una-variabile.ejs +0 -11
  99. package/docs/template-engine/examples/esempio3-piu-variabili.ejs +0 -15
  100. package/docs/template-engine/examples/esempio4-condizionale.ejs +0 -18
  101. package/docs/template-engine/examples/esempio5-loop.ejs +0 -18
  102. package/docs/template-engine/examples/index-esempi.html +0 -181
  103. package/docs/template-engine/examples/index.html +0 -40
  104. package/docs/template-engine/examples/test.ejs +0 -64
  105. package/eslint.config.mjs +0 -17
  106. package/jest.config.js +0 -18
@@ -1,354 +0,0 @@
1
-
2
- > koa-classic-server@1.2.0 test:performance
3
- > jest __tests__/performance.test.js --runInBand
4
-
5
- console.log
6
-
7
- 📊 Small File (1KB) Benchmark:
8
-
9
- at Object.log (__tests__/performance.test.js:90:21)
10
-
11
- console.log
12
- Average: 2.93ms
13
-
14
- at Object.log (__tests__/performance.test.js:91:21)
15
-
16
- console.log
17
- Median: 2.48ms
18
-
19
- at Object.log (__tests__/performance.test.js:92:21)
20
-
21
- console.log
22
- Min: 1.90ms
23
-
24
- at Object.log (__tests__/performance.test.js:93:21)
25
-
26
- console.log
27
- Max: 25.14ms
28
-
29
- at Object.log (__tests__/performance.test.js:94:21)
30
-
31
- console.log
32
-
33
- 📊 Medium File (100KB) Benchmark:
34
-
35
- at Object.log (__tests__/performance.test.js:109:21)
36
-
37
- console.log
38
- Average: 3.13ms
39
-
40
- at Object.log (__tests__/performance.test.js:110:21)
41
-
42
- console.log
43
- Median: 3.15ms
44
-
45
- at Object.log (__tests__/performance.test.js:111:21)
46
-
47
- console.log
48
- Min: 2.31ms
49
-
50
- at Object.log (__tests__/performance.test.js:112:21)
51
-
52
- console.log
53
- Max: 4.11ms
54
-
55
- at Object.log (__tests__/performance.test.js:113:21)
56
-
57
- console.log
58
-
59
- 📊 Large File (1MB) Benchmark:
60
-
61
- at Object.log (__tests__/performance.test.js:128:21)
62
-
63
- console.log
64
- Average: 8.76ms
65
-
66
- at Object.log (__tests__/performance.test.js:129:21)
67
-
68
- console.log
69
- Median: 9.85ms
70
-
71
- at Object.log (__tests__/performance.test.js:130:21)
72
-
73
- console.log
74
- Min: 5.79ms
75
-
76
- at Object.log (__tests__/performance.test.js:131:21)
77
-
78
- console.log
79
- Max: 11.72ms
80
-
81
- at Object.log (__tests__/performance.test.js:132:21)
82
-
83
- console.log
84
-
85
- 📊 Small Directory (100 files) Benchmark:
86
-
87
- at Object.log (__tests__/performance.test.js:150:21)
88
-
89
- console.log
90
- Average: 2.68ms
91
-
92
- at Object.log (__tests__/performance.test.js:151:21)
93
-
94
- console.log
95
- Median: 2.53ms
96
-
97
- at Object.log (__tests__/performance.test.js:152:21)
98
-
99
- console.log
100
- Min: 2.22ms
101
-
102
- at Object.log (__tests__/performance.test.js:153:21)
103
-
104
- console.log
105
- Max: 4.79ms
106
-
107
- at Object.log (__tests__/performance.test.js:154:21)
108
-
109
- console.log
110
-
111
- 📊 Large Directory (1,000 files) Benchmark:
112
-
113
- at Object.log (__tests__/performance.test.js:168:21)
114
-
115
- console.log
116
- Average: 9.49ms
117
-
118
- at Object.log (__tests__/performance.test.js:169:21)
119
-
120
- console.log
121
- Median: 9.16ms
122
-
123
- at Object.log (__tests__/performance.test.js:170:21)
124
-
125
- console.log
126
- Min: 8.20ms
127
-
128
- at Object.log (__tests__/performance.test.js:171:21)
129
-
130
- console.log
131
- Max: 11.49ms
132
-
133
- at Object.log (__tests__/performance.test.js:172:21)
134
-
135
- console.log
136
- ⚠️ WARNING: This will be MUCH faster after async optimization
137
-
138
- at Object.log (__tests__/performance.test.js:175:21)
139
-
140
- console.log
141
-
142
- 📊 Very Large Directory (10,000 files) Benchmark:
143
-
144
- at Object.log (__tests__/performance.test.js:189:21)
145
-
146
- console.log
147
- Average: 90.06ms
148
-
149
- at Object.log (__tests__/performance.test.js:190:21)
150
-
151
- console.log
152
- Median: 90.14ms
153
-
154
- at Object.log (__tests__/performance.test.js:191:21)
155
-
156
- console.log
157
- Min: 87.00ms
158
-
159
- at Object.log (__tests__/performance.test.js:192:21)
160
-
161
- console.log
162
- Max: 93.29ms
163
-
164
- at Object.log (__tests__/performance.test.js:193:21)
165
-
166
- console.log
167
- ⚠️ WARNING: Event loop BLOCKED during this operation!
168
-
169
- at Object.log (__tests__/performance.test.js:194:21)
170
-
171
- console.log
172
- ⚠️ Expected to drop to ~27.02ms after optimization
173
-
174
- at Object.log (__tests__/performance.test.js:195:21)
175
-
176
- console.log
177
-
178
- 📊 10 Concurrent Small Files:
179
-
180
- at Object.log (__tests__/performance.test.js:212:21)
181
-
182
- console.log
183
- Total time: 14.35ms
184
-
185
- at Object.log (__tests__/performance.test.js:213:21)
186
-
187
- console.log
188
- Avg per request: 1.43ms
189
-
190
- at Object.log (__tests__/performance.test.js:214:21)
191
-
192
- console.log
193
-
194
- 📊 5 Concurrent Directory Listings (100 files):
195
-
196
- at Object.log (__tests__/performance.test.js:231:21)
197
-
198
- console.log
199
- Total time: 7.26ms
200
-
201
- at Object.log (__tests__/performance.test.js:232:21)
202
-
203
- console.log
204
- Avg per request: 1.45ms
205
-
206
- at Object.log (__tests__/performance.test.js:233:21)
207
-
208
- console.log
209
- ⚠️ With current sync code, these run SEQUENTIALLY
210
-
211
- at Object.log (__tests__/performance.test.js:234:21)
212
-
213
- console.log
214
- ⚠️ After async optimization, will run in PARALLEL
215
-
216
- at Object.log (__tests__/performance.test.js:235:21)
217
-
218
- console.log
219
-
220
- 📊 404 Not Found Benchmark:
221
-
222
- at Object.log (__tests__/performance.test.js:252:21)
223
-
224
- console.log
225
- Average: 1.53ms
226
-
227
- at Object.log (__tests__/performance.test.js:253:21)
228
-
229
- console.log
230
- Median: 1.43ms
231
-
232
- at Object.log (__tests__/performance.test.js:254:21)
233
-
234
- console.log
235
- Min: 1.24ms
236
-
237
- at Object.log (__tests__/performance.test.js:255:21)
238
-
239
- console.log
240
- Max: 3.80ms
241
-
242
- at Object.log (__tests__/performance.test.js:256:21)
243
-
244
- console.log
245
-
246
- 📊 Memory Usage (10,000 files directory):
247
-
248
- at Object.log (__tests__/performance.test.js:278:21)
249
-
250
- console.log
251
- Heap used increase: 0.96 MB
252
-
253
- at Object.log (__tests__/performance.test.js:279:21)
254
-
255
- console.log
256
- External increase: 2.54 MB
257
-
258
- at Object.log (__tests__/performance.test.js:280:21)
259
-
260
- console.log
261
- Response size: 1.29 MB
262
-
263
- at Object.log (__tests__/performance.test.js:281:21)
264
-
265
- console.log
266
- ⚠️ Expected to reduce by ~30-40% after optimization
267
-
268
- at Object.log (__tests__/performance.test.js:282:21)
269
-
270
- console.log
271
-
272
- ======================================================================
273
-
274
- at Object.log (__tests__/performance.test.js:289:13)
275
-
276
- console.log
277
- 📋 BASELINE BENCHMARK SUMMARY
278
-
279
- at Object.log (__tests__/performance.test.js:290:13)
280
-
281
- console.log
282
- ======================================================================
283
-
284
- at Object.log (__tests__/performance.test.js:291:13)
285
-
286
- console.log
287
-
288
- These results represent the CURRENT performance (v1.2.0)
289
-
290
- at Object.log (__tests__/performance.test.js:292:13)
291
-
292
- console.log
293
- After implementing optimizations, run this test again to see improvements.
294
-
295
- at Object.log (__tests__/performance.test.js:293:13)
296
-
297
- console.log
298
- Expected improvements after optimization:
299
-
300
- at Object.log (__tests__/performance.test.js:294:13)
301
-
302
- console.log
303
- ✓ Small files: 10-20% faster (async operations)
304
-
305
- at Object.log (__tests__/performance.test.js:295:13)
306
-
307
- console.log
308
- ✓ Large directories: 50-70% faster (async + array join)
309
-
310
- at Object.log (__tests__/performance.test.js:296:13)
311
-
312
- console.log
313
- ✓ Concurrent requests: 5-10x faster (non-blocking event loop)
314
-
315
- at Object.log (__tests__/performance.test.js:297:13)
316
-
317
- console.log
318
- ✓ Memory usage: 30-40% reduction (array join vs concatenation)
319
-
320
- at Object.log (__tests__/performance.test.js:298:13)
321
-
322
- console.log
323
- ✓ With HTTP caching: 80-95% faster (304 responses)
324
-
325
- at Object.log (__tests__/performance.test.js:299:13)
326
-
327
- console.log
328
- ======================================================================
329
-
330
- at Object.log (__tests__/performance.test.js:300:13)
331
-
332
- PASS __tests__/performance.test.js
333
- Performance Benchmarks - BASELINE (v1.2.0)
334
- File Serving Performance
335
- ✓ Benchmark: Small file (1KB) - 100 iterations (322 ms)
336
- ✓ Benchmark: Medium file (100KB) - 50 iterations (160 ms)
337
- ✓ Benchmark: Large file (1MB) - 20 iterations (178 ms)
338
- Directory Listing Performance
339
- ✓ Benchmark: Small directory (100 files) - 50 iterations (136 ms)
340
- ✓ Benchmark: Large directory (1,000 files) - 20 iterations (192 ms)
341
- ✓ Benchmark: Very large directory (10,000 files) - 5 iterations (454 ms)
342
- Concurrent Request Performance
343
- ✓ Benchmark: 10 concurrent small file requests (17 ms)
344
- ✓ Benchmark: 5 concurrent directory listings (100 files each) (9 ms)
345
- 404 Not Found Performance
346
- ✓ Benchmark: Non-existent file - 50 iterations (79 ms)
347
- Memory Usage (Informational)
348
- ✓ Memory usage during large directory listing (90 ms)
349
-
350
- Test Suites: 1 passed, 1 total
351
- Tests: 10 passed, 10 total
352
- Snapshots: 0 total
353
- Time: 2.781 s, estimated 4 s
354
- Ran all test suites matching /__tests__\/performance.test.js/i.
@@ -1,372 +0,0 @@
1
-
2
- > koa-classic-server@3.0.0-alpha.0 test:performance
3
- > jest __tests__/performance.test.js --runInBand
4
-
5
- console.warn
6
- [koa-classic-server] WARNING: hidden.dotFiles.default and/or hidden.dotDirs.default are not explicitly set.
7
- Since v3.0.0 the defaults are: dotFiles → "hidden", dotDirs → "visible".
8
- To suppress this warning, add to your configuration:
9
- hidden: { dotFiles: { default: 'hidden' }, dotDirs: { default: 'visible' } }
10
- (adjust values to match your desired behaviour)
11
-
12
- 735 | if (dotFilesImplicit || dotDirsImplicit) {
13
- 736 | _hiddenDefaultWarnEmitted = true;
14
- > 737 | _logger.warn(...warnPayload(_logger,
15
- | ^
16
- 738 | '[koa-classic-server] WARNING: hidden.dotFiles.default and/or hidden.dotDirs.default are not explicitly set.\n' +
17
- 739 | ' Since v3.0.0 the defaults are: dotFiles → "hidden", dotDirs → "visible".\n' +
18
- 740 | ' To suppress this warning, add to your configuration:\n' +
19
-
20
- at koaClassicServer (index.cjs:737:21)
21
- at Object.koaClassicServer (__tests__/performance.test.js:139:17)
22
-
23
- console.log
24
-
25
- 📊 Small File (1KB) Benchmark:
26
-
27
- at Object.log (__tests__/performance.test.js:159:21)
28
-
29
- console.log
30
- Average: 2.09ms
31
-
32
- at Object.log (__tests__/performance.test.js:160:21)
33
-
34
- console.log
35
- Median: 1.66ms
36
-
37
- at Object.log (__tests__/performance.test.js:161:21)
38
-
39
- console.log
40
- Min: 1.40ms
41
-
42
- at Object.log (__tests__/performance.test.js:162:21)
43
-
44
- console.log
45
- Max: 22.92ms
46
-
47
- at Object.log (__tests__/performance.test.js:163:21)
48
-
49
- console.log
50
-
51
- 📊 Medium File (100KB) Benchmark:
52
-
53
- at Object.log (__tests__/performance.test.js:178:21)
54
-
55
- console.log
56
- Average: 2.06ms
57
-
58
- at Object.log (__tests__/performance.test.js:179:21)
59
-
60
- console.log
61
- Median: 1.93ms
62
-
63
- at Object.log (__tests__/performance.test.js:180:21)
64
-
65
- console.log
66
- Min: 1.65ms
67
-
68
- at Object.log (__tests__/performance.test.js:181:21)
69
-
70
- console.log
71
- Max: 4.47ms
72
-
73
- at Object.log (__tests__/performance.test.js:182:21)
74
-
75
- console.log
76
-
77
- 📊 Large File (1MB) Benchmark:
78
-
79
- at Object.log (__tests__/performance.test.js:197:21)
80
-
81
- console.log
82
- Average: 7.19ms
83
-
84
- at Object.log (__tests__/performance.test.js:198:21)
85
-
86
- console.log
87
- Median: 5.82ms
88
-
89
- at Object.log (__tests__/performance.test.js:199:21)
90
-
91
- console.log
92
- Min: 4.53ms
93
-
94
- at Object.log (__tests__/performance.test.js:200:21)
95
-
96
- console.log
97
- Max: 21.60ms
98
-
99
- at Object.log (__tests__/performance.test.js:201:21)
100
-
101
- console.log
102
-
103
- 📊 Small Directory (100 files) Benchmark:
104
-
105
- at Object.log (__tests__/performance.test.js:219:21)
106
-
107
- console.log
108
- Average: 5.22ms
109
-
110
- at Object.log (__tests__/performance.test.js:220:21)
111
-
112
- console.log
113
- Median: 4.65ms
114
-
115
- at Object.log (__tests__/performance.test.js:221:21)
116
-
117
- console.log
118
- Min: 4.03ms
119
-
120
- at Object.log (__tests__/performance.test.js:222:21)
121
-
122
- console.log
123
- Max: 17.47ms
124
-
125
- at Object.log (__tests__/performance.test.js:223:21)
126
-
127
- console.log
128
-
129
- 📊 Large Directory (1,000 files) Benchmark:
130
-
131
- at Object.log (__tests__/performance.test.js:237:21)
132
-
133
- console.log
134
- Average: 28.83ms
135
-
136
- at Object.log (__tests__/performance.test.js:238:21)
137
-
138
- console.log
139
- Median: 28.80ms
140
-
141
- at Object.log (__tests__/performance.test.js:239:21)
142
-
143
- console.log
144
- Min: 26.80ms
145
-
146
- at Object.log (__tests__/performance.test.js:240:21)
147
-
148
- console.log
149
- Max: 31.02ms
150
-
151
- at Object.log (__tests__/performance.test.js:241:21)
152
-
153
- console.log
154
- ⚠️ WARNING: This will be MUCH faster after async optimization
155
-
156
- at Object.log (__tests__/performance.test.js:244:21)
157
-
158
- console.log
159
-
160
- 📊 Very Large Directory (10,000 files) Benchmark:
161
-
162
- at Object.log (__tests__/performance.test.js:258:21)
163
-
164
- console.log
165
- Average: 265.99ms
166
-
167
- at Object.log (__tests__/performance.test.js:259:21)
168
-
169
- console.log
170
- Median: 266.27ms
171
-
172
- at Object.log (__tests__/performance.test.js:260:21)
173
-
174
- console.log
175
- Min: 261.83ms
176
-
177
- at Object.log (__tests__/performance.test.js:261:21)
178
-
179
- console.log
180
- Max: 271.55ms
181
-
182
- at Object.log (__tests__/performance.test.js:262:21)
183
-
184
- console.log
185
- ⚠️ WARNING: Event loop BLOCKED during this operation!
186
-
187
- at Object.log (__tests__/performance.test.js:263:21)
188
-
189
- console.log
190
- ⚠️ Expected to drop to ~79.80ms after optimization
191
-
192
- at Object.log (__tests__/performance.test.js:264:21)
193
-
194
- console.log
195
-
196
- 📊 10 Concurrent Small Files:
197
-
198
- at Object.log (__tests__/performance.test.js:281:21)
199
-
200
- console.log
201
- Total time: 13.28ms
202
-
203
- at Object.log (__tests__/performance.test.js:282:21)
204
-
205
- console.log
206
- Avg per request: 1.33ms
207
-
208
- at Object.log (__tests__/performance.test.js:283:21)
209
-
210
- console.log
211
-
212
- 📊 5 Concurrent Directory Listings (100 files):
213
-
214
- at Object.log (__tests__/performance.test.js:300:21)
215
-
216
- console.log
217
- Total time: 18.73ms
218
-
219
- at Object.log (__tests__/performance.test.js:301:21)
220
-
221
- console.log
222
- Avg per request: 3.75ms
223
-
224
- at Object.log (__tests__/performance.test.js:302:21)
225
-
226
- console.log
227
- ⚠️ With current sync code, these run SEQUENTIALLY
228
-
229
- at Object.log (__tests__/performance.test.js:303:21)
230
-
231
- console.log
232
- ⚠️ After async optimization, will run in PARALLEL
233
-
234
- at Object.log (__tests__/performance.test.js:304:21)
235
-
236
- console.log
237
-
238
- 📊 404 Not Found Benchmark:
239
-
240
- at Object.log (__tests__/performance.test.js:321:21)
241
-
242
- console.log
243
- Average: 1.26ms
244
-
245
- at Object.log (__tests__/performance.test.js:322:21)
246
-
247
- console.log
248
- Median: 1.11ms
249
-
250
- at Object.log (__tests__/performance.test.js:323:21)
251
-
252
- console.log
253
- Min: 0.92ms
254
-
255
- at Object.log (__tests__/performance.test.js:324:21)
256
-
257
- console.log
258
- Max: 3.88ms
259
-
260
- at Object.log (__tests__/performance.test.js:325:21)
261
-
262
- console.log
263
-
264
- 📊 Memory Usage (10,000 files directory):
265
-
266
- at Object.log (__tests__/performance.test.js:347:21)
267
-
268
- console.log
269
- Heap used increase: 6.97 MB
270
-
271
- at Object.log (__tests__/performance.test.js:348:21)
272
-
273
- console.log
274
- External increase: 0.25 MB
275
-
276
- at Object.log (__tests__/performance.test.js:349:21)
277
-
278
- console.log
279
- Response size: 0.02 MB
280
-
281
- at Object.log (__tests__/performance.test.js:350:21)
282
-
283
- console.log
284
- ⚠️ Expected to reduce by ~30-40% after optimization
285
-
286
- at Object.log (__tests__/performance.test.js:351:21)
287
-
288
- console.log
289
-
290
- ======================================================================
291
-
292
- at Object.log (__tests__/performance.test.js:358:13)
293
-
294
- console.log
295
- 📋 BASELINE BENCHMARK SUMMARY
296
-
297
- at Object.log (__tests__/performance.test.js:359:13)
298
-
299
- console.log
300
- ======================================================================
301
-
302
- at Object.log (__tests__/performance.test.js:360:13)
303
-
304
- console.log
305
-
306
- These results represent the CURRENT performance (v1.2.0)
307
-
308
- at Object.log (__tests__/performance.test.js:361:13)
309
-
310
- console.log
311
- After implementing optimizations, run this test again to see improvements.
312
-
313
- at Object.log (__tests__/performance.test.js:362:13)
314
-
315
- console.log
316
- Expected improvements after optimization:
317
-
318
- at Object.log (__tests__/performance.test.js:363:13)
319
-
320
- console.log
321
- ✓ Small files: 10-20% faster (async operations)
322
-
323
- at Object.log (__tests__/performance.test.js:364:13)
324
-
325
- console.log
326
- ✓ Large directories: 50-70% faster (async + array join)
327
-
328
- at Object.log (__tests__/performance.test.js:365:13)
329
-
330
- console.log
331
- ✓ Concurrent requests: 5-10x faster (non-blocking event loop)
332
-
333
- at Object.log (__tests__/performance.test.js:366:13)
334
-
335
- console.log
336
- ✓ Memory usage: 30-40% reduction (array join vs concatenation)
337
-
338
- at Object.log (__tests__/performance.test.js:367:13)
339
-
340
- console.log
341
- ✓ With HTTP caching: 80-95% faster (304 responses)
342
-
343
- at Object.log (__tests__/performance.test.js:368:13)
344
-
345
- console.log
346
- ======================================================================
347
-
348
- at Object.log (__tests__/performance.test.js:369:13)
349
-
350
- PASS __tests__/performance.test.js
351
- Performance Benchmarks - BASELINE (v1.2.0)
352
- File Serving Performance
353
- ✓ Benchmark: Small file (1KB) - 100 iterations (215 ms)
354
- ✓ Benchmark: Medium file (100KB) - 50 iterations (107 ms)
355
- ✓ Benchmark: Large file (1MB) - 20 iterations (146 ms)
356
- Directory Listing Performance
357
- ✓ Benchmark: Small directory (100 files) - 50 iterations (264 ms)
358
- ✓ Benchmark: Large directory (1,000 files) - 20 iterations (579 ms)
359
- ✓ Benchmark: Very large directory (10,000 files) - 5 iterations (1333 ms)
360
- Concurrent Request Performance
361
- ✓ Benchmark: 10 concurrent small file requests (15 ms)
362
- ✓ Benchmark: 5 concurrent directory listings (100 files each) (21 ms)
363
- 404 Not Found Performance
364
- ✓ Benchmark: Non-existent file - 50 iterations (65 ms)
365
- Memory Usage (Informational)
366
- ✓ Memory usage during large directory listing (269 ms)
367
-
368
- Test Suites: 1 passed, 1 total
369
- Tests: 10 passed, 10 total
370
- Snapshots: 0 total
371
- Time: 3.365 s, estimated 5 s
372
- Ran all test suites matching __tests__/performance.test.js.