Commit 4768d31
committed
fix: single-pass XY-cut partition to remove O(n^2) blow-up on dense pages (0.9.1)
split_block now buckets chars into child blocks in one bisect-based pass instead of re-scanning all chars per child. Removes the 0.5pt boundary slack that duplicated chars into adjacent children and drove super-linear time/memory growth on high-glyph pages. A 49,713-char page that previously OOM'd now finishes in <1s; reading-order output is byte-identical to the old engine across a 40-poster sample.1 parent 6096d58 commit 4768d31
3 files changed
Lines changed: 39 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
65 | 95 | | |
66 | 96 | | |
67 | 97 | | |
| |||
114 | 144 | | |
115 | 145 | | |
116 | 146 | | |
117 | | - | |
118 | | - | |
| 147 | + | |
119 | 148 | | |
120 | 149 | | |
121 | 150 | | |
| |||
127 | 156 | | |
128 | 157 | | |
129 | 158 | | |
130 | | - | |
131 | | - | |
| 159 | + | |
132 | 160 | | |
133 | 161 | | |
134 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments