Skip to content

Commit b6fe04a

Browse files
committed
Simplify simple line walking and benchmark inline flow
1 parent 53c343f commit b6fe04a

7 files changed

Lines changed: 540 additions & 302 deletions

File tree

benchmarks/chrome.json

Lines changed: 84 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,95 @@
33
"results": [
44
{
55
"label": "Our library: prepare()",
6-
"ms": 20.149999991059303,
6+
"ms": 19.599999994039536,
77
"desc": "One cold 500-text measurement batch"
88
},
99
{
1010
"label": "Our library: layout()",
11-
"ms": 0.1575,
11+
"ms": 0.1380000001192093,
1212
"desc": "Normalized hot-path throughput per 500-text batch"
1313
},
1414
{
1515
"label": "DOM batch",
16-
"ms": 4.299999997019768,
16+
"ms": 4.149999976158142,
1717
"desc": "Single 400→300px batch resize: write all, then read all"
1818
},
1919
{
2020
"label": "DOM interleaved",
21-
"ms": 42.6000000089407,
21+
"ms": 42.849999994039536,
2222
"desc": "Single 400→300px batch resize: write + read per div"
2323
}
2424
],
2525
"richResults": [
2626
{
2727
"label": "Our library: layoutWithLines()",
28-
"ms": 0.05750000029802323,
28+
"ms": 0.053750000149011615,
2929
"desc": "60-text shared-corpus batch across widths 180/220/260px; materializes text lines"
3030
},
3131
{
3232
"label": "Our library: walkLineRanges()",
33-
"ms": 0.027500000223517417,
33+
"ms": 0.027499999105930328,
3434
"desc": "60-text shared-corpus batch across widths 180/220/260px; geometry only, no line text strings"
3535
},
3636
{
3737
"label": "Our library: layoutNextLine()",
38-
"ms": 0.04750000014901161,
38+
"ms": 0.04749999940395355,
3939
"desc": "60-text shared-corpus batch across widths 180/220/260px; streaming line-by-line layout"
4040
}
4141
],
42+
"inlineFlowResults": [
43+
{
44+
"label": "Our library: measureInlineFlowGeometry()",
45+
"ms": 0.011250000447034836,
46+
"desc": "36 mixed-inline shared-corpus texts across widths 180/220/260px; aggregate geometry only"
47+
},
48+
{
49+
"label": "Our library: walkInlineFlowLineRanges()",
50+
"ms": 0.019999999552965164,
51+
"desc": "36 mixed-inline shared-corpus texts across widths 180/220/260px; per-line geometry with fragment ranges, no text strings"
52+
},
53+
{
54+
"label": "Our library: walkInlineFlowLines()",
55+
"ms": 0.05500000044703483,
56+
"desc": "36 mixed-inline shared-corpus texts across widths 180/220/260px; per-line materialization through the batch walker"
57+
},
58+
{
59+
"label": "Our library: layoutNextInlineFlowLine()",
60+
"ms": 0.05,
61+
"desc": "36 mixed-inline shared-corpus texts across widths 180/220/260px; streaming per-line materialization"
62+
}
63+
],
4264
"richPreWrapResults": [
4365
{
4466
"label": "Our library: layoutWithLines()",
45-
"ms": 0.39499999955296516,
67+
"ms": 0.4024999991059304,
4668
"desc": "12 generated pre-wrap texts with 320 hard-break chunks across widths 220/260/320px; materializes text lines"
4769
},
4870
{
4971
"label": "Our library: walkLineRanges()",
50-
"ms": 0.19750000014901162,
72+
"ms": 0.24000000059604645,
5173
"desc": "12 generated pre-wrap texts with 320 hard-break chunks across widths 220/260/320px; geometry only, no line text strings"
5274
},
5375
{
5476
"label": "Our library: layoutNextLine()",
55-
"ms": 0.975,
77+
"ms": 1.0099999994039535,
5678
"desc": "12 generated pre-wrap texts with 320 hard-break chunks across widths 220/260/320px; streaming line-by-line layout"
5779
}
5880
],
5981
"richLongResults": [
6082
{
6183
"label": "Our library: layoutWithLines()",
62-
"ms": 8.486250000074506,
84+
"ms": 8.26875,
6385
"desc": "8 Arabic long-form texts across widths 240/300/360px; materializes text lines"
6486
},
6587
{
6688
"label": "Our library: walkLineRanges()",
67-
"ms": 5.151249999925494,
89+
"ms": 4.683750000596046,
6890
"desc": "8 Arabic long-form texts across widths 240/300/360px; geometry only, no line text strings"
6991
},
7092
{
7193
"label": "Our library: layoutNextLine()",
72-
"ms": 5.428749999776482,
94+
"ms": 5.941250000149012,
7395
"desc": "8 Arabic long-form texts across widths 240/300/360px; streaming line-by-line layout"
7496
}
7597
],
@@ -84,9 +106,9 @@
84106
"breakableSegments": 0,
85107
"width": 300,
86108
"lineCount": 193,
87-
"analysisMs": 2.2000000178813934,
88-
"measureMs": 4.5999999940395355,
89-
"prepareMs": 6.799999982118607,
109+
"analysisMs": 7.900000035762787,
110+
"measureMs": 5.400000035762787,
111+
"prepareMs": 13.199999988079071,
90112
"layoutMs": 0.026500000059604643
91113
},
92114
{
@@ -99,10 +121,10 @@
99121
"breakableSegments": 1,
100122
"width": 300,
101123
"lineCount": 380,
102-
"analysisMs": 4.199999988079071,
103-
"measureMs": 8.5,
104-
"prepareMs": 13.299999982118607,
105-
"layoutMs": 0.051000000089406965
124+
"analysisMs": 4.5,
125+
"measureMs": 9.400000035762787,
126+
"prepareMs": 14.299999952316284,
127+
"layoutMs": 0.04899999976158142
106128
},
107129
{
108130
"id": "ko-unsu-joh-eun-nal",
@@ -114,10 +136,10 @@
114136
"breakableSegments": 0,
115137
"width": 300,
116138
"lineCount": 428,
117-
"analysisMs": 2.5,
118-
"measureMs": 8.900000005960464,
119-
"prepareMs": 11.299999982118607,
120-
"layoutMs": 0.08650000005960465
139+
"analysisMs": 2.699999988079071,
140+
"measureMs": 10.300000011920929,
141+
"prepareMs": 13,
142+
"layoutMs": 0.07650000005960464
121143
},
122144
{
123145
"id": "zh-zhufu",
@@ -129,10 +151,10 @@
129151
"breakableSegments": 4,
130152
"width": 300,
131153
"lineCount": 626,
132-
"analysisMs": 6.9000000059604645,
133-
"measureMs": 14.099999994039536,
134-
"prepareMs": 21,
135-
"layoutMs": 0.08
154+
"analysisMs": 6.800000011920929,
155+
"measureMs": 15.300000011920929,
156+
"prepareMs": 22.30000001192093,
157+
"layoutMs": 0.0775
136158
},
137159
{
138160
"id": "zh-guxiang",
@@ -144,9 +166,9 @@
144166
"breakableSegments": 14,
145167
"width": 300,
146168
"lineCount": 375,
147-
"analysisMs": 4,
148-
"measureMs": 9,
149-
"prepareMs": 13.599999994039536,
169+
"analysisMs": 4.300000011920929,
170+
"measureMs": 9.199999988079071,
171+
"prepareMs": 13.899999976158142,
150172
"layoutMs": 0.0475
151173
},
152174
{
@@ -159,10 +181,10 @@
159181
"breakableSegments": 8087,
160182
"width": 300,
161183
"lineCount": 1024,
162-
"analysisMs": 9,
163-
"measureMs": 6.700000017881393,
164-
"prepareMs": 15.799999982118607,
165-
"layoutMs": 0.09899999991059304
184+
"analysisMs": 9.099999964237213,
185+
"measureMs": 6.800000011920929,
186+
"prepareMs": 16.599999964237213,
187+
"layoutMs": 0.08799999982118606
166188
},
167189
{
168190
"id": "my-cunning-heron-teacher",
@@ -175,9 +197,9 @@
175197
"width": 300,
176198
"lineCount": 81,
177199
"analysisMs": 0.699999988079071,
178-
"measureMs": 0.800000011920929,
179-
"prepareMs": 1.4000000059604645,
180-
"layoutMs": 0.007999999970197678
200+
"measureMs": 0.9000000357627869,
201+
"prepareMs": 1.5,
202+
"layoutMs": 0.00699999988079071
181203
},
182204
{
183205
"id": "my-bad-deeds-return-to-you-teacher",
@@ -189,10 +211,10 @@
189211
"breakableSegments": 274,
190212
"width": 300,
191213
"lineCount": 54,
192-
"analysisMs": 0.4000000059604645,
193-
"measureMs": 0.5999999940395355,
214+
"analysisMs": 0.40000003576278687,
215+
"measureMs": 0.6000000238418579,
194216
"prepareMs": 1,
195-
"layoutMs": 0.005
217+
"layoutMs": 0.0044999998807907105
196218
},
197219
{
198220
"id": "ur-chughd",
@@ -204,10 +226,10 @@
204226
"breakableSegments": 2922,
205227
"width": 300,
206228
"lineCount": 351,
207-
"analysisMs": 2.7000000178813934,
208-
"measureMs": 3.899999976158142,
209-
"prepareMs": 6.9000000059604645,
210-
"layoutMs": 0.050999999940395356
229+
"analysisMs": 2.799999952316284,
230+
"measureMs": 5,
231+
"prepareMs": 7.799999952316284,
232+
"layoutMs": 0.043499999940395356
211233
},
212234
{
213235
"id": "km-prachum-reuang-preng-khmer-volume-7-stories-1-10",
@@ -219,10 +241,10 @@
219241
"breakableSegments": 4010,
220242
"width": 300,
221243
"lineCount": 591,
222-
"analysisMs": 5.899999976158142,
223-
"measureMs": 4.699999988079071,
224-
"prepareMs": 11.199999988079071,
225-
"layoutMs": 0.09899999991059304
244+
"analysisMs": 6.300000011920929,
245+
"measureMs": 5.599999964237213,
246+
"prepareMs": 11.800000011920929,
247+
"layoutMs": 0.08599999994039535
226248
},
227249
{
228250
"id": "hi-eidgah",
@@ -234,10 +256,10 @@
234256
"breakableSegments": 4090,
235257
"width": 300,
236258
"lineCount": 653,
237-
"analysisMs": 4.5,
238-
"measureMs": 6.9000000059604645,
239-
"prepareMs": 11.5,
240-
"layoutMs": 0.08350000008940697
259+
"analysisMs": 4.600000023841858,
260+
"measureMs": 8.200000047683716,
261+
"prepareMs": 13,
262+
"layoutMs": 0.07050000011920929
241263
},
242264
{
243265
"id": "synthetic-long-breakable-runs",
@@ -249,10 +271,10 @@
249271
"breakableSegments": 1760,
250272
"width": 300,
251273
"lineCount": 2860,
252-
"analysisMs": 8.699999988079071,
253-
"measureMs": 10.599999994039536,
254-
"prepareMs": 20.400000005960464,
255-
"layoutMs": 0.3779999999701977
274+
"analysisMs": 9.699999988079071,
275+
"measureMs": 11.5,
276+
"prepareMs": 21.5,
277+
"layoutMs": 0.3235000002384186
256278
},
257279
{
258280
"id": "ar-risalat-al-ghufran-part-1",
@@ -264,11 +286,11 @@
264286
"breakableSegments": 18745,
265287
"width": 300,
266288
"lineCount": 2643,
267-
"analysisMs": 32.29999998211861,
268-
"measureMs": 37.39999997615814,
269-
"prepareMs": 68.7999999821186,
270-
"layoutMs": 0.3254999999701977
289+
"analysisMs": 20.599999964237213,
290+
"measureMs": 54.5,
291+
"prepareMs": 75,
292+
"layoutMs": 0.27450000017881393
271293
}
272294
],
273-
"requestId": "1775293362360-623cm0f8o0o"
295+
"requestId": "1775315117196-76v7jdo45na"
274296
}

0 commit comments

Comments
 (0)