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

error annotation leads to puzzle #161

Closed
wants to merge 1 commit into from
Closed

error annotation leads to puzzle #161

wants to merge 1 commit into from

Conversation

qshuai
Copy link
Contributor

@qshuai qshuai commented Jan 31, 2018

InsecureRandRange(10) will generate a random number in [0, 10], that is ten every eleven iterations...

@qshuai qshuai closed this Jan 31, 2018
@qshuai qshuai reopened this Jan 31, 2018
@qshuai qshuai closed this Jan 31, 2018
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 13, 2021
Summary
---

This MR is part of on-going work to optimize
`CTxMemPool::removeForBlock`, as discussed in issue Bitcoin-ABC#161.

As such, it adds a benchmark for this function versus a full mempool of
~450k unchained txns.

The bench calls removeForBlock repeatedly with block txns from a ~32MB
block versus a very full mempool.

Also an 8MB block version is provided as well.

Test Plan
---

- `ninja all check bench_bitcoin`
- `src/bench/bench_bitcoin -filter='RemoveForBlock.*'`
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 13, 2021
Summary
---

As discussed in issue Bitcoin-ABC#161, the performance of `removeForBlock` in particular
is a critical path that deserves optimization.

This MR significantly improves the performance of `removeForBlock` from 0% to
as much as 100% or more, depending on the exact mempool layout in question.

The changes introduced also happen to improve the general performance of the
mempool as well.

Minor RPC Change
---

- As a result of these optimizations, the mempool-related RPC calls that
  describe a mempool entry's `spentby` (list of mempool txs that spend a
  particular mempool tx) have a different sort order now. Previously, this list
  would be sorted by txid. Now, it is sorted topologically.
- `getmempooldescendants` and `getmempoolancestors` now also no longer returns a
  list that is sorted by `TxId` but is rather topologically sorted (by
  `entryId`).

Test Plan
---

- `ninja all check-all`

Run these benches on master versus this MR commit:

- `ninja bench_bitcoin && src/bench/bench_bitcoin -filter='(RemoveForBlock.*)|(MempoolAcc.*)|(Reorg.*)|(Generat.*)|(Evict.*)'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant