-
Notifications
You must be signed in to change notification settings - Fork 59
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
Uniform keys option for stress test. #185
Conversation
admin/src/bench/mod.rs
Outdated
for k in 0..num_keys { | ||
let index = self.cache_start + k; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for k in 0..num_keys { | |
let index = self.cache_start + k; | |
for index in self.cache_start..num_keys + k { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -252,6 +294,19 @@ pub fn run_internal(args: Args, db: Db) { | |||
0 | |||
}; | |||
|
|||
let mut pool = SizePool::from_histogram(sizes::KUSAMA_STATE_DISTRIBUTION, args.uniform); | |||
if args.uniform { | |||
println!("Generating uniform keys."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not too sure when we hit non cached keys, but good to have the code for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Reader threads when appending will hit them. Also, writer threads when pruning and appending can hit them sometimes. Might have missed something else.
Applies the hash function when generating keys and uses a uniform column. It also generates the keys before running the rest of the stress test so the hash function isn't used during the test. I found this useful for profiling.
Caveats
Uses memory to store all the keys.
When appending to a database it only generates keys for the current run. Reader threads can read from the whole database so will sometimes end up executing the hash function during the test.