Repository navigation
Commit 54c9572
[improvement](be) Reserve an object's field spans before checking its fields
The reusable validator dropped the reservation the one-shot validator made
for each object. Callers that still validate every value with a fresh
validator, such as ColumnVariantV2::deserialize() through insert_data(),
then grew the span buffer from zero for each wide object: about ten
allocations for an object of 1000 fields instead of one.
require_valid_object() now reserves base + count spans before checking the
fields. It takes at least twice the current capacity, so sibling objects
that each need a little more space do not reallocate one entry at a time: in
a root of 26 objects of 30 fields, field k needs k + 30 entries, and the
buffer grows 26 -> 52 -> 104 instead of once per sibling.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>1 parent 714d816 commit 54c9572
2 files changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
665 | 692 | | |
666 | 693 | | |
667 | 694 | | |
| |||
0 commit comments