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
Fix external state in benchmarking (edit.rs) #1155
base: master
Are you sure you want to change the base?
Conversation
@@ -72,7 +72,6 @@ fn benchmark_char_insertion_one_line_edit(b: &mut Bencher) { | |||
let mut offset = 100; | |||
b.iter(|| { | |||
text.edit(offset..=offset, "a"); | |||
offset += 1; |
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.
maybe it still makes sense to do some loop inside the iter
? we can just make it some fixed length.
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 many of these functions we still may want to be doing a loop in the iteration, we just want to be doing it the same each time. This is the right general idea though!
Hmm, So you mean to say all the functions use the same offset update ? for eg
would be the offset for all the benchmarks? |
I would use whatever they were using before, but inside an explicit loop, and having |
@kanishkarj this is very close to mergeable if you want to update again! |
This is in reference to the discussion in PR #1152. This PR fixes the external state of the iterations in the benchmarks.