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

👷 Setup benchmark workflow with pytest-codspeed #4

Merged
merged 5 commits into from
Feb 29, 2024

Conversation

weiji14
Copy link
Owner

@weiji14 weiji14 commented Feb 28, 2024

Measuring the execution speed of unit tests to track performance of cog3pio Python functions over time.

Using pytest-codspeed to do the benchmarking, with the help of https://github.com/CodSpeedHQ/action. Decorated test_read_geotiff with @pytest.mark.benchmark to see if the benchmarking works.

Note: Running the benchmarks on Python 3.12 to enable flame graph generation, available with pytest-codspeed>=2.0.0 - see https://docs.codspeed.io/features/trace-generation.

References:

Pytest plugin to create CodSpeed benchmarks!
Will run benchmarks on this unit test soon!
@weiji14 weiji14 force-pushed the continuous-benchmarking branch from 91deb98 to e3d15df Compare February 28, 2024 21:04
Measuring the execution speed of unit tests to track performance of cog3pio Python functions over time. Using pytest-codspeed, see https://docs.codspeed.io/benchmarks/python#running-the-benchmarks-in-your-ci.
@weiji14 weiji14 force-pushed the continuous-benchmarking branch from e3d15df to c4f3f95 Compare February 28, 2024 21:10
Copy link

codspeed-hq bot commented Feb 28, 2024

CodSpeed Performance Report

Congrats! CodSpeed is installed 🎉

🆕 1 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks

  • test_read_geotiff_local (424.4 µs)

@weiji14
Copy link
Owner Author

weiji14 commented Feb 29, 2024

Flame graphs at https://codspeed.io/weiji14/cog3pio/branches/continuous-benchmarking:

image
image

Most time seems to be spent on the tiff decoder, makes sense!

Might have other tests reading GeoTIFFs across the network, so renaming this unit test function.
@weiji14 weiji14 marked this pull request as ready for review February 29, 2024 00:08
Also re-format the release-types: published trigger
@weiji14 weiji14 enabled auto-merge (squash) February 29, 2024 00:11
@weiji14 weiji14 merged commit 0c37e32 into main Feb 29, 2024
14 checks passed
@weiji14 weiji14 deleted the continuous-benchmarking branch February 29, 2024 00:36
@weiji14 weiji14 added this to the 0.1.0 milestone Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant