-
Notifications
You must be signed in to change notification settings - Fork 233
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
Tx pool rewrite with multi_index_map #3993
Tx pool rewrite with multi_index_map #3993
Conversation
7f75581
to
c78eef0
Compare
2487a0f
to
47606a7
Compare
00a97ea
to
f206295
Compare
26cfe98
to
eabc345
Compare
I have finished some benchmark testing for comparing develop branch, code: https://github.com/chenyukang/ckb/tree/develop-bench test component::tests::bench::test_container_bench_add ... bench: 2,144,760 ns/iter (+/- 3,794,550)
test component::tests::bench::test_container_bench_add_remove ... bench: 9,826,341 ns/iter (+/- 336,570)
test component::tests::bench::test_container_bench_sort ... bench: 4,752,366 ns/iter (+/- 418,446) current branch bench, code: https://github.com/chenyukang/ckb/tree/tx_pool_refactor_bench test component::tests::bench::test_container_bench_add ... bench: 1,956,728 ns/iter (+/- 4,352,650)
test component::tests::bench::test_container_bench_add_remove ... bench: 10,976,779 ns/iter (+/- 174,750)
test component::tests::bench::test_container_bench_sort ... bench: 3,896,260 ns/iter (+/- 102,732) It seems |
Is this good enough? The |
3cdcd68
to
1ade496
Compare
Yes, upstream From the above benchmark data, we can say the performance is on the same level with trivial difference. I guess this difference won't have too much effect on the whole CKB, since there are I have concern on the memory, today I write some testing code to verify it. I constantly add The memory footprint is: 2w 65.7 MB
3w 86.1 MB
4w 131.5 MB
5w 158.2 MB
6w 201.4 MB But we have Anyway, let's wait for the result from acceptance, I talked with them today for the testing. |
8c89be8
to
a709291
Compare
What problem does this PR solve?
Problem Summary:
What is changed and how it works?
This PR unifies the
pending
andgap
pool withmulti_index_map
, with these two benefits:tx_pool
for future improvementCheck List
Tests
Side effects
This PR may introduce performance regression for
tx_pool
, another change is we now do double-spend checking when a transaction is added to the pool.I will do more testing for this change.
Release note