Commit 1004ee6
authored
perf: streaming subtree serialization with go-bt v2.6.0 (#100)
* perf: use SerializeTo for streaming subtree serialization
Replace SerializeBytes() + Write() with SerializeTo(w) in
WriteTransactionsToWriter, writing transaction data directly to the
io.Writer without allocating intermediate byte slices.
This eliminates per-tx Output.Bytes() and Input.ExtendedBytes()
allocations during subtree serialization. For a 3.64 GB block
(28,672 txs), this reduced HandleBlockDirect allocations by ~10.6 GB.
Depends on go-bt SerializeTo method (bsv-blockchain/go-bt#117).
* perf: upgrade go-bt to v2.6.0 for streaming serialization
Update go-bt dependency to v2.6.0 which adds zero-allocation WriteTo/
SerializeTo methods. The subtree serialization now uses SerializeTo to
stream transaction data directly to the writer instead of allocating
intermediate byte slices.1 parent 1d0c624 commit 1004ee6
3 files changed
Lines changed: 11 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
| 141 | + | |
| 142 | + | |
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
| |||
0 commit comments