-
Notifications
You must be signed in to change notification settings - Fork 786
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
[Don't merge] Stress test for CircularBuffer #1086
Conversation
2e57404
to
c5340b1
Compare
Need help from folks to stress it on different architecture / platforms with different combinations of settings. |
da24f10
to
f0978fa
Compare
Ran the stress on x64 (12 cores 3.6GHz, Intel W-2133) and Surface Pro X (3.0GHz 8 cores ARM64) with .NET core 5.0 preview for ARM64, stress passed for more than 10 runs on each platform. BTW: the race condition ratio of below line is ~1% (means failed to add 1 event among 100 events) on X64 and ~7% on ARM64. |
Why would you have so many powerful 💪 machines? 🤣 |
This is a stress test tool for the Circular Buffer [#1085].
The test is writing to a circular buffer from N parallel tasks, where N is the number of logical processors.
Each writer is inserting monotonic numbers to the circular buffer, starting from
1
tobound
inclusively ([1, bound]
). If the buffer is full, the writer will retry until success.A single task is reading from the circular buffer, calculating the total sum of the numbers.
Near real-time statistics are displayed in the console window title.
When all the writer/reader tasks finished, the
result
value should be0
, otherwise it indicates a bug in the implementation.Test buffer size can be changed to simulate different situation.
For example, changing the buffer size to a smaller number would simulate the insertion failure/retry case: