Commit db92989
committed
Faster -reindex by initially deserializing only headers
When a block is initially read from a blk*.dat file during reindexing,
it can be added to the block index only if all of its ancestor blocks
have been added, which is rare. If the block's ancestors have not been
added, the block must be re-read from disk later when it can be added.
This commit: During the initial block read, deserialize only its header,
rather than the entire block, since this is sufficient to determine
if its parent (and thus all its ancestors) has been added. This is a
performance improvement.1 parent c72de99 commit db92989
2 files changed
+78
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4393 | 4393 | | |
4394 | 4394 | | |
4395 | 4395 | | |
| 4396 | + | |
| 4397 | + | |
4396 | 4398 | | |
4397 | 4399 | | |
4398 | 4400 | | |
| |||
4416 | 4418 | | |
4417 | 4419 | | |
4418 | 4420 | | |
| 4421 | + | |
4419 | 4422 | | |
4420 | 4423 | | |
4421 | 4424 | | |
4422 | | - | |
4423 | | - | |
| 4425 | + | |
| 4426 | + | |
4424 | 4427 | | |
4425 | 4428 | | |
4426 | 4429 | | |
4427 | | - | |
4428 | | - | |
4429 | | - | |
4430 | | - | |
4431 | | - | |
4432 | | - | |
| 4430 | + | |
| 4431 | + | |
| 4432 | + | |
| 4433 | + | |
| 4434 | + | |
| 4435 | + | |
| 4436 | + | |
4433 | 4437 | | |
4434 | 4438 | | |
4435 | 4439 | | |
4436 | | - | |
| 4440 | + | |
4437 | 4441 | | |
4438 | | - | |
| 4442 | + | |
4439 | 4443 | | |
4440 | | - | |
| 4444 | + | |
4441 | 4445 | | |
4442 | 4446 | | |
4443 | 4447 | | |
4444 | 4448 | | |
4445 | 4449 | | |
4446 | 4450 | | |
4447 | 4451 | | |
4448 | | - | |
4449 | | - | |
4450 | | - | |
4451 | | - | |
4452 | | - | |
4453 | | - | |
4454 | | - | |
| 4452 | + | |
| 4453 | + | |
| 4454 | + | |
| 4455 | + | |
| 4456 | + | |
| 4457 | + | |
| 4458 | + | |
| 4459 | + | |
| 4460 | + | |
| 4461 | + | |
| 4462 | + | |
| 4463 | + | |
| 4464 | + | |
4455 | 4465 | | |
4456 | 4466 | | |
4457 | 4467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
30 | 77 | | |
31 | 78 | | |
32 | 79 | | |
33 | 80 | | |
34 | 81 | | |
35 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
36 | 86 | | |
37 | 87 | | |
0 commit comments