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

Feat: Add benchmark #242

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Feat: Add benchmark #242

merged 2 commits into from
Nov 21, 2024

Conversation

woile
Copy link
Member

@woile woile commented Nov 20, 2024

Warning

This PR introduced a breaking change, because it removes support for python 3.8

This PR adds benchmark capabilities to the repo by using pytest-benchmark

This will allow us to guarantee no regressions on performance on the benchmarked code.

As of now, I've added a check for benchmark-compare-fail=min:5%:

will make the suite fail if Min is 5% slower for any test

But it's worth exploring and adding more options.

How it works?

  • on merge -> create benchmarks for the current release. It runs ./script/bench-current, it will create a json file inside .benchmarks/ per platform and python version (probably a lot of files because we test against many versions, which is good), the results will be commited and pushed back to the primary branch, it will not trigger a new release.
  • on PR -> test no regressions are introduced. It runs ./script/bench-current, creating a json file, but this time, it won't be commited. Instead it will just check that it's not over a certain threshold.

./scripts/bench-compare is a convenience script which you can run locally.

@woile woile requested a review from marcosschroh November 20, 2024 14:07
Copy link
Contributor

github-actions bot commented Nov 20, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://kpn.github.io/kstreams/pr-preview/pr-242/
on branch gh-pages at 2024-11-21 14:38 UTC

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.73%. Comparing base (c222b81) to head (0b3d40d).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #242   +/-   ##
=======================================
  Coverage   95.73%   95.73%           
=======================================
  Files          24       24           
  Lines         961      961           
=======================================
  Hits          920      920           
  Misses         41       41           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@woile woile force-pushed the feat/bench branch 4 times, most recently from 83178ec to 8b006b8 Compare November 21, 2024 13:48
@woile woile merged commit 4015c91 into master Nov 21, 2024
8 checks passed
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.

2 participants