Commit f7dcb5f
committed
Optimize read_node with slice indexing to reduce bounds checks
- Used slice indexing (e.g., &buf[offset..offset+3]) instead of individual byte indexing.
- This allows the compiler to perform a single bounds check for the entire read operation.
- Benchmarks show a ~5% improvement in lookup performance (86ns -> 82ns).1 parent a96dc7a commit f7dcb5f
1 file changed
+11
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
454 | | - | |
455 | | - | |
| 453 | + | |
| 454 | + | |
456 | 455 | | |
457 | 456 | | |
458 | 457 | | |
| |||
461 | 460 | | |
462 | 461 | | |
463 | 462 | | |
| 463 | + | |
464 | 464 | | |
465 | | - | |
466 | | - | |
467 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
475 | 476 | | |
476 | 477 | | |
477 | 478 | | |
| |||
0 commit comments