Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: fine tune concurrency level for mainnet benchmark #262

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kien-rise
Copy link
Contributor

@kien-rise kien-rise commented Aug 21, 2024

This PR sets the concurrency level dynamically as follows:

if block.transactions.len() <= 140 { 8 } else { 13 }
Why 8, 13 and 140? image

The latest benchmark shows that this change is 0.27% faster than naively running with 13 threads.

Block #txs #gas S P8.P13 P12 P13 P14
46147 1 21000 0.005 0.005 0.005 0.005 0.005
116525 83 2625335 0.269 0.268 0.269 0.270 0.269
930196 18 378000 0.049 0.048 0.049 0.049 0.049
1150000 9 649041 0.102 0.101 0.101 0.102 0.101
1796867 49 3917663 0.336 0.337 0.335 0.336 0.337
2179522 222 4698004 0.615 0.509 0.505 0.509 0.515
2462997 9 484186 3.392 3.359 3.379 3.397 3.372
2641321 83 1917429 0.287 0.284 0.287 0.287 0.286
2674998 16 1915348 0.130 0.129 0.129 0.130 0.129
2675000 15 1312529 0.111 0.111 0.111 0.111 0.111
2688148 4 2725844 0.185 0.186 0.185 0.186 0.186
3356896 176 4033966 0.582 0.480 0.476 0.484 0.482
4330482 237 6669817 1.050 0.511 0.515 0.513 0.514
4369999 22 6630311 1.001 0.575 0.605 0.609 0.614
4370000 97 6609719 2.063 1.918 1.997 2.011 2.034
4864590 195 7985890 2.625 0.706 0.707 0.709 0.736
5283152 150 7979463 2.555 0.660 0.670 0.660 0.655
5526571 143 7988261 2.089 0.889 0.899 0.889 0.887
5891667 380 7980153 0.923 0.642 0.634 0.645 0.648
6137495 60 7994690 1.260 0.693 0.726 0.734 0.741
6196166 108 7975867 1.058 0.982 1.014 1.023 1.031
7279999 122 7998886 4.584 1.100 1.045 1.044 1.047
7280000 118 7992790 4.538 2.327 2.329 2.336 2.342
8038679 237 7993635 2.173 0.917 0.922 0.918 0.919
8889776 330 9996021 3.074 1.267 1.263 1.271 1.269
9068998 3 3575534 0.812 0.813 0.809 0.812 0.810
9069000 56 8762935 4.000 2.269 2.284 2.297 2.305
10760440 202 12466618 5.118 2.092 2.053 2.092 2.097
11114732 100 12450745 3.641 4.172 4.069 4.059 4.050
11743952 206 11955916 11.862 12.829 12.816 12.820 12.966
11814555 579 12494001 1.611 1.055 1.058 1.065 1.062
12047794 232 12486404 4.358 4.846 4.813 4.835 4.818
12159808 180 12478883 4.258 4.841 4.821 4.794 4.840
12243999 205 12444977 4.699 1.702 1.698 1.707 1.706
12244000 133 12450737 6.988 4.342 4.379 4.391 4.404
12300570 687 14934316 2.097 1.270 1.254 1.273 1.278
12459406 201 14994849 7.185 3.837 3.806 3.818 3.825
12520364 660 14989902 2.800 1.552 1.553 1.568 1.560
12522062 177 15028295 3.150 1.282 1.291 1.281 1.276
12964999 145 15026712 9.955 5.191 5.234 5.189 5.237
12965000 259 30025257 22.214 6.229 6.438 6.212 6.134
13217637 1100 29985362 8.148 2.705 2.727 2.720 2.724
13287210 1414 29990789 4.190 2.544 2.500 2.516 2.551
14029313 724 30074554 7.541 2.004 2.045 2.013 1.973
14334629 819 30135754 9.835 3.312 3.293 3.303 3.300
14383540 722 30059751 11.717 3.912 3.911 3.911 3.856
14396881 1346 30020813 4.736 2.745 2.672 2.739 2.757
14545870 456 29925884 13.332 3.851 3.903 3.858 3.806
15199017 866 30028395 8.653 2.489 2.502 2.500 2.488
15274915 1226 29928443 5.960 2.597 2.591 2.566 2.568
15537393 1 29991429 2.170 2.154 2.169 2.168 2.170
15537394 80 29983006 2.535 1.971 1.968 1.995 1.969
15538827 823 29981465 9.336 3.008 2.992 2.971 3.006
15752489 132 8242594 2.941 1.280 1.332 1.336 1.347
16146267 473 19204593 8.128 2.855 2.900 2.873 2.833
16257471 98 20267875 11.890 7.425 7.456 7.455 7.464
17034869 93 8450250 3.696 1.433 1.549 1.560 1.567
17034870 184 29999074 10.398 4.324 4.349 4.315 4.312
17666333 961 29983414 14.412 7.139 7.125 7.146 7.122
18085863 178 17007666 7.878 4.346 4.364 4.356 4.324
18426253 147 18889343 12.182 8.105 8.147 8.101 8.082
18988207 186 12398324 12.512 7.810 7.822 7.809 7.811
19426586 127 15757891 8.098 3.848 3.883 3.901 3.905
19426587 37 2633933 3.160 3.164 3.167 3.170 3.162
19498855 241 29919049 17.059 8.057 8.208 8.044 8.014
19638737 381 15932416 6.546 3.277 3.246 3.282 3.246
19807137 712 29981386 20.095 9.748 9.812 9.751 9.720
19910734 0 0 0.002 0.002 0.002 0.002 0.002
19917570 116 12889065 5.808 2.123 2.117 2.161 2.188
19923400 24 1624049 0.743 0.744 0.749 0.748 0.745
19929064 103 7743849 3.800 1.937 1.887 1.884 1.888
19932148 227 14378808 7.005 3.381 3.378 3.390 3.399
19932703 143 10421765 13.110 9.290 9.355 9.290 9.268
19932810 270 18643597 7.965 3.605 3.603 3.612 3.598
19933122 45 2056821 0.685 0.691 0.688 0.688 0.686
19933597 154 12788678 4.231 2.377 2.368 2.379 2.384
19933612 130 11236414 7.521 1.872 2.052 2.073 2.093
19934116 58 3365857 1.794 1.793 1.797 1.799 1.790
Average     5.251 2.708 2.720 2.716 2.715

@kien-rise kien-rise marked this pull request as ready for review August 21, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant