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

chore: reduce noise in benchmarks #151

Merged
merged 2 commits into from
Dec 31, 2022
Merged

Conversation

Noah-Kennedy
Copy link
Contributor

Removes FuturesUnordered from benchmarks and alters timing to ignore task spawning, as to hone in on specifically the processing of ops and driver performance.


[package.metadata.docs.rs]
all-features = true

[profile.bench]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for flamegraph generation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this obvious to most people looking at the Cargo.toml? If so, then fine. If not, maybe a line comment?

@Noah-Kennedy
Copy link
Contributor Author

@ollie-etl I'm gating this on your approval.

@FrankReh
Copy link
Collaborator

Where do you see the FuturesUnordered name in the flame graph? Just out of curiosity ...

@Noah-Kennedy
Copy link
Contributor Author

Noah-Kennedy commented Oct 27, 2022

@FrankReh See here:
flamegraph

Notice how much time is spent within various futures crate codepaths.

@Noah-Kennedy
Copy link
Contributor Author

Noah-Kennedy commented Oct 27, 2022

At the very least this cleans up the flamegraphs by moving everything into tokio codepaths.

@Noah-Kennedy
Copy link
Contributor Author

Here is a flamegraph with these changes.
flamegraph

@Noah-Kennedy
Copy link
Contributor Author

Granted, this would all be much cleaner if I didn't run it in a bench, but still...

@FrankReh
Copy link
Collaborator

FrankReh commented Oct 27, 2022

Ha. I guess you know what you're looking for. I still barely see core::future in those flames. Maybe I'm blind today. But great you are having a look. I can learn a lot by seeing what you end up finding and changing.

I'm just happy I can reproduce the other problem. I'll work on it tomorrow.

Comment on lines +50 to +58
let mut js = JoinSet::new();

for _ in 0..opts.iterations {
js.spawn_local(tokio_uring::no_op());
}

while let Some(res) = js.join_next().await {
res.unwrap().unwrap();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is fine - everything in this method is timed.

@ollie-etl
Copy link
Collaborator

ollie-etl commented Oct 27, 2022

@Noah-Kennedy Please cherry-pick cb676c85, which is pushed to git@github.com:etlsystems/ollie/benchmark-improvements.git

That commit cleans up the use of criterion now the runtime is exposed. It also exposes a bug introduced (I think) in #148. I'm not all that sure about the runtime stuff yet - could you take a look?

The commit also limits the flame graph to the profiled region.

@Noah-Kennedy
Copy link
Contributor Author

Sure! @ollie-etl could you file an issue for the new bug?

@oliverbunting
Copy link

Sure! @ollie-etl could you file an issue for the new bug?

Will do. I'm out of office until next week

@ollie-etl
Copy link
Collaborator

Sure! @ollie-etl could you file an issue for the new bug?
@Noah-Kennedy See #160

@ollie-etl
Copy link
Collaborator

@Noah-Kennedy Would you mind pulling cb676c8 into this PR? I think it improves the benchmarking code significantly

@oliverbunting
Copy link

@Noah-Kennedy can you get this in? I use the benchmarks a lot to check what I've done is sane, and tidying them up would be nice

@Noah-Kennedy
Copy link
Contributor Author

@oliverbunting I'll fix this up and get this in shortly then.

@FrankReh
Copy link
Collaborator

@Noah-Kennedy Can you have a look at this again? I would like to get some benchmarks, especially now that 6.1 is out.

Removes FuturesUnordered from benchmarks and alters timing to ignore task spawning, as to hone in on specifically the processing of ops and driver performance.
@Noah-Kennedy
Copy link
Contributor Author

@FrankReh yeah I'll fix this up

@Noah-Kennedy
Copy link
Contributor Author

@FrankReh could you take a look at this, I think it's fine as is

Copy link
Collaborator

@FrankReh FrankReh left a comment

Choose a reason for hiding this comment

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

yea, I'm not experienced at using the benchmarking within rust. But it's nice to get this in and then we can play around.


[package.metadata.docs.rs]
all-features = true

[profile.bench]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this obvious to most people looking at the Cargo.toml? If so, then fine. If not, maybe a line comment?

benches/criterion/no_op.rs Show resolved Hide resolved
@FrankReh
Copy link
Collaborator

@Noah-Kennedy Will let you squash and merge.

@Noah-Kennedy Noah-Kennedy merged commit 9b654c1 into master Dec 31, 2022
@Noah-Kennedy Noah-Kennedy deleted the noah/benchmark-improvements branch December 31, 2022 23:27
Noah-Kennedy pushed a commit that referenced this pull request Jan 2, 2023
A number of errors got overlooked in #151 and earlier PRs targeting the criterion benchmarks. In particular, the throughput, concurrency, and iteration count values were all wrong.

This change addresses those issues.
FrankReh added a commit to FrankReh/tokio-uring that referenced this pull request Jan 2, 2023
rrichardson pushed a commit to rrichardson/tokio-uring that referenced this pull request Jan 12, 2023
Removes FuturesUnordered from benchmarks and alters timing to ignore
task spawning, as to hone in on specifically the processing of ops and
driver performance.
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

4 participants