Commit eb9ff8e
Use 50% load factor for
In certain workloads (e.g. Speedometer3, Editor-TipTap) the
hash-table lookup becomes very expensive and may require up to 25 probes (specifically for `fDigestForPackedGlyphID`). From local
experiments I see that this is not the problem of the hash function,
but rather the load faсtor of the HashTable, which is currently hardcoded to 75%.
The CL provides a way to customize this behaviour by adding an
optional `ShouldGrow(size, capacity)` function into `Traits`. The
function is also specialized for `fDigestForPackedGlyphID` to have
the load factor of 50%. This significantly reduces the number of extra
probes, increasing the ratio of 0-probe hits from 88% to 97% on the
overall Speedometer3 benchmark. No more than 5 probes are required.
The CL improves the Editor-TipTap Speedometer3 story by 1.3%.
Change-Id: Iedda0710839448e8df98d649456a168104488272
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/939016
Commit-Queue: Anton Bikineev <[email protected]>
Reviewed-by: Michael Ludwig <[email protected]>
Reviewed-by: Ben Wagner <[email protected]>fDigestForPackedGlyphID table1 parent 9d51bc2 commit eb9ff8e
2 files changed
+59
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
375 | 384 | | |
376 | 385 | | |
377 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
102 | 112 | | |
103 | 113 | | |
104 | 114 | | |
| |||
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
146 | | - | |
147 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
148 | 166 | | |
149 | 167 | | |
150 | 168 | | |
| |||
192 | 210 | | |
193 | 211 | | |
194 | 212 | | |
195 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
196 | 221 | | |
197 | 222 | | |
198 | 223 | | |
| |||
274 | 299 | | |
275 | 300 | | |
276 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
277 | 323 | | |
278 | 324 | | |
279 | 325 | | |
| |||
0 commit comments