Commit 4959fba
committed
feat(zen): deep chain and read optimizations
- Set CLEAN state after CHECK verification (avoid redundant checks)
- Early exit in _updateIfNecessary when source changed
- Length caching in loops (avoid repeated .length access)
- Optimized read() with observer check first
- Guard _updateIfNecessary calls with state check
Target improvements:
- Very Deep Chain (100 layers): >300K ops/sec (was 249K)
- Extreme Read (10000x): >80K ops/sec (was 64K)
- Reduced overhead in STATE_CHECK propagation
All 48 tests pass.1 parent 051cb20 commit 4959fba
File tree
3 files changed
+38
-10
lines changed- .changeset
- packages/zen
- src
3 files changed
+38
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | 248 | | |
250 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
251 | 255 | | |
252 | 256 | | |
253 | 257 | | |
| |||
289 | 293 | | |
290 | 294 | | |
291 | 295 | | |
292 | | - | |
| 296 | + | |
| 297 | + | |
293 | 298 | | |
294 | 299 | | |
295 | | - | |
| 300 | + | |
296 | 301 | | |
297 | 302 | | |
298 | 303 | | |
| |||
304 | 309 | | |
305 | 310 | | |
306 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
307 | 315 | | |
308 | | - | |
309 | | - | |
310 | 316 | | |
311 | 317 | | |
312 | 318 | | |
| |||
353 | 359 | | |
354 | 360 | | |
355 | 361 | | |
356 | | - | |
| 362 | + | |
| 363 | + | |
357 | 364 | | |
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
361 | 368 | | |
362 | 369 | | |
363 | 370 | | |
364 | | - | |
| 371 | + | |
| 372 | + | |
365 | 373 | | |
366 | 374 | | |
367 | 375 | | |
| |||
0 commit comments