Commit 0b2442c
committed
Improve table search speed through lookups
Prior to this change table search would have to do a binary search over
about 1000 entries which resulted in around 10 memory loads on average.
In this commit we reduce the search space by doing a pre-lookup in a
generated table to get a smaller (often zero-length) slice of the full
sorted range list. On average this gives us just one entry of the range
list to perform binary search on, which reduces the average number of
memory loads to 2.1 parent 07e6155 commit 0b2442c
2 files changed
+314
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
277 | 293 | | |
278 | 294 | | |
279 | 295 | | |
280 | 296 | | |
281 | 297 | | |
282 | 298 | | |
283 | | - | |
| 299 | + | |
284 | 300 | | |
285 | 301 | | |
286 | 302 | | |
| |||
293 | 309 | | |
294 | 310 | | |
295 | 311 | | |
296 | | - | |
| 312 | + | |
297 | 313 | | |
298 | 314 | | |
299 | 315 | | |
| |||
302 | 318 | | |
303 | 319 | | |
304 | 320 | | |
305 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
306 | 327 | | |
307 | 328 | | |
308 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
309 | 341 | | |
310 | 342 | | |
311 | 343 | | |
| |||
0 commit comments