Slightly Improve Unit Tests for Checkqueue#10099
Conversation
|
Great!
I'd prefer to create a deterministic |
18b4830 to
690acd1
Compare
|
Tested with 5 runs of master (edc62c9): avg = ~53623841usvs 5 runs of this PR (5004e46): avg = ~39955330us= ~1.3times speed increase |
|
@fanquake what architecture are you running on? How many cores? Anyways, on my system I clock the original test suite (e.g., still getrand) as taking 0.3s after my queue improvements, so I think it's safe to just wait until those make it in for a performance gain. |
src/test/checkqueue_tests.cpp
Outdated
abfcd05 to
7831902
Compare
…). Fix a test to check the exclusive or of two properties rather than just or.
7831902 to
8c2f4b8
Compare
|
utACK 8c2f4b8 |
| fails = queue->ControlMutex.try_lock(); | ||
| } | ||
| { | ||
| // Unfreeze (we need lock n case of spurious wakeup) |
| } | ||
| // Unfreeze | ||
| } | ||
| // Try to get control of the queue a bunch of times |
There was a problem hiding this comment.
Maybe add "must always fail" or "should always fail."
|
Can this be merged? It's a simple test improvement with two acks. |
|
utACK 8c2f4b8 |
8c2f4b8 Expose more parallelism with relaxed atomics (suggested in #9938). Fix a test to check the exclusive or of two properties rather than just or. (Jeremy Rubin) Pull request description: This PR is in response to #10026 and some feedback on #9938. ~Locally, all the checkqueue tests ran 3.2X faster on my machine. The worst offender, `test_CheckQueue_Correct_Random` ran 3.4X faster.~ 1. ~Removes `GetRand()` and replaces it with a single deterministic FastRandomContext instance.~ #10321 replicated this 1. Exposes more parallelism with relaxed atomics, increasing chance of catching a bug. This does not change performance on my machine. 1. Makes one test case more restrictive (xor instead of or, see #9938). Tree-SHA512: a59dfbee0273c713525a130dfedc1c7ff26f50c2aaca1e94ef5d759b1d6ea6338ffbd97f863b9f6209750d8a788a15fa8ae1bf26774ed2473c520811337e6b00
8c2f4b8 Expose more parallelism with relaxed atomics (suggested in bitcoin#9938). Fix a test to check the exclusive or of two properties rather than just or. (Jeremy Rubin) Pull request description: This PR is in response to bitcoin#10026 and some feedback on bitcoin#9938. ~Locally, all the checkqueue tests ran 3.2X faster on my machine. The worst offender, `test_CheckQueue_Correct_Random` ran 3.4X faster.~ 1. ~Removes `GetRand()` and replaces it with a single deterministic FastRandomContext instance.~ bitcoin#10321 replicated this 1. Exposes more parallelism with relaxed atomics, increasing chance of catching a bug. This does not change performance on my machine. 1. Makes one test case more restrictive (xor instead of or, see bitcoin#9938). Tree-SHA512: a59dfbee0273c713525a130dfedc1c7ff26f50c2aaca1e94ef5d759b1d6ea6338ffbd97f863b9f6209750d8a788a15fa8ae1bf26774ed2473c520811337e6b00
This PR is in response to #10026 and some feedback on #9938.
Locally, all the checkqueue tests ran 3.2X faster on my machine. The worst offender,test_CheckQueue_Correct_Randomran 3.4X faster.RemovesUse FastRandomContext for all tests #10321 replicated thisGetRand()and replaces it with a single deterministic FastRandomContext instance.Exposes more parallelism with relaxed atomics, increasing chance of catching a bug. This does not change performance on my machine.
Makes one test case more restrictive (xor instead of or, see Lock-Free CheckQueue #9938).