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

Update Benchmark set up and persist benchmarks #180

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mimischi
Copy link
Member

We have recently updated our toolchain version to 5.9, but have never updated the benchmark suite to use 5.9 or newer. Also, it does not look like we ever commited a baseline to this repository.

While at it, wiring up GitHub actions to run the benchmarks for every pull request, as well as on a merge into main. Re-uses a lot of the heavy lifting that was defined in apple/swift-nio already.

Note that nightly-main appears broken at the moment. The Benchmark tool gets stuck, and initial debugging point to it never finishing _sendAndAcknowledgeMessages when producing a set of messages before every benchmark.

We have recently updated our toolchain version to 5.9, but have never
updated the benchmark suite to use 5.9 or newer. Also, it does not look
like we ever commited a baseline to this repository.

While at it, wiring up GitHub actions to run the benchmarks for every
pull request, as well as on a merge into `main`. Re-uses a lot of the
heavy lifting that was defined in `apple/swift-nio` already.

Note that `nightly-main` appears broken at the moment. The Benchmark
tool gets stuck, and initial debugging point to it never finishing
`_sendAndAcknowledgeMessages` when producing a set of messages before
every benchmark.
@mimischi mimischi requested review from FranzBusch and rnro November 25, 2024 13:09
@mimischi mimischi added the semver/none No version bump required. label Nov 25, 2024
@mimischi
Copy link
Member Author

Right. So the benchmark performs worse on GitHub Actions than on my local machine. What's the blessed approach of introducing a baseline then?

@Lukasa
Copy link

Lukasa commented Nov 25, 2024

Extract the values from GH actions and use those as the baseline, sadly.

Copy link
Contributor

@rnro rnro left a comment

Choose a reason for hiding this comment

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

Overall this looks really good, it'll be great to have the benchmarks up and running in CI. Just some small comments.

Unfortunately as Cory pointed out we don't have a great story for updating the thresholds right now but it's something I'm hoping to improve.

.github/workflows/unit_tests.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/cxx_interop.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/benchmarks.yml Outdated Show resolved Hide resolved
Comment on lines 1 to 10
{
"allocatedResidentMemory" : 77266944,
"cpuTotal" : 200000000,
"objectAllocCount" : 5549,
"releaseCount" : 15168,
"retainCount" : 7108,
"retainReleaseDelta" : 2511,
"throughput" : 2,
"wallClock" : 695307500
}
Copy link
Contributor

Choose a reason for hiding this comment

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

In most of our repositories we only add benchmarks for mallocCountTotal because it is a stable measure. We don't yet have dedicated runners which would be required for time-based benchmarks

see e.g. https://github.com/apple/swift-nio/blob/main/Benchmarks/Thresholds/5.9/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json

Changes the benchmark to iterate over the consume loop a total of 1000
times. We now produce 1000*1000 (1e6) messages into the topic, and on
every benchmark iteration consume 1000 messages each.

I had to comment the `librdkafka_with_offset_commit_messages_*`
benchmark. For some reason, the benchmark suite keeps re-running it, and
I have seen occasional failures when attempting to commit offsets. It's
unclear to me why that happens right now, but decided it's not worth the
investigation at the moment.
`swift build` was happy for whatever reason beofre.
Keeps `scalingFactor: .kilo`, but only measures `.mallocCountTotal`, as
that should be a reproducible value across different systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants