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

Uniform keys option for stress test. #185

Merged
merged 4 commits into from
Feb 9, 2023

Conversation

MattHalpinParity
Copy link
Contributor

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.

Comment on lines 140 to 141
for k in 0..num_keys {
let index = self.cache_start + k;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for k in 0..num_keys {
let index = self.cache_start + k;
for index in self.cache_start..num_keys + k {

Copy link
Contributor Author

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.");
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@arkpar arkpar merged commit f4cb293 into paritytech:master Feb 9, 2023
@MattHalpinParity MattHalpinParity deleted the uniform_keys branch February 9, 2023 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants