Commit be127bc
Replace vecAskFor with a priority queue (#3147)
This avoids sorting before looping through it to figure out what to
request. The assumption that sorting would be cheap when vecAskFor is
already mostly sorted (only unsorted at the end) turned out to be false.
In reality, ~50% of CPU time was consumed by the sort when a lot of traffic
(thousands of TXs) happen.1 parent a13a918 commit be127bc
3 files changed
+24
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3221 | 3221 | | |
3222 | 3222 | | |
3223 | 3223 | | |
3224 | | - | |
| 3224 | + | |
3225 | 3225 | | |
3226 | 3226 | | |
3227 | 3227 | | |
3228 | | - | |
| 3228 | + | |
3229 | 3229 | | |
3230 | 3230 | | |
3231 | 3231 | | |
| |||
3235 | 3235 | | |
3236 | 3236 | | |
3237 | 3237 | | |
3238 | | - | |
| 3238 | + | |
3239 | 3239 | | |
3240 | 3240 | | |
3241 | | - | |
| 3241 | + | |
3242 | 3242 | | |
3243 | 3243 | | |
3244 | 3244 | | |
| |||
3262 | 3262 | | |
3263 | 3263 | | |
3264 | 3264 | | |
3265 | | - | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
3266 | 3268 | | |
3267 | 3269 | | |
3268 | 3270 | | |
3269 | 3271 | | |
3270 | | - | |
3271 | | - | |
3272 | | - | |
3273 | | - | |
3274 | | - | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
3275 | 3276 | | |
3276 | 3277 | | |
3277 | 3278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
843 | 844 | | |
844 | 845 | | |
845 | 846 | | |
846 | | - | |
| 847 | + | |
| 848 | + | |
847 | 849 | | |
848 | 850 | | |
849 | 851 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3964 | 3964 | | |
3965 | 3965 | | |
3966 | 3966 | | |
3967 | | - | |
3968 | | - | |
3969 | | - | |
| 3967 | + | |
3970 | 3968 | | |
3971 | | - | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
3972 | 3976 | | |
3973 | 3977 | | |
3974 | 3978 | | |
| |||
3984 | 3988 | | |
3985 | 3989 | | |
3986 | 3990 | | |
3987 | | - | |
| 3991 | + | |
| 3992 | + | |
3988 | 3993 | | |
3989 | | - | |
3990 | 3994 | | |
3991 | 3995 | | |
3992 | 3996 | | |
| |||
0 commit comments