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

Add github actions workflow for perfomance comparison in pull requests #100

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

zkulbeda
Copy link
Contributor

@zkulbeda zkulbeda commented Aug 13, 2023

This pr is coupled with another pr #99, which is required for testing this workflow in current pr.

The workflow runs vitest benchmark two times (on pr and main branch), collects its output, compare and format a table with results. This table will be included into sticky comment with following example content:

Performance changes

Measured performance changes between f4e6e99 and f4e6e99.

Show table
description name before, hz rme after, hz rme diff
Lorem ipsum dolor sit amet, consectetur valibot 3,373.77 ±3.44% 3,373,198.77 ±30.44% +3.12%
zod 5,478,188.77 ±10.44% 3,363,198.77 ±3.44% +0.12%
yup 9,373,198.77 ±3% 7,373,198.77 ±3.44% +3.12%
Lorem ipsum dolor sit amet, consectetur valibot 3,373.77 ±3.44% 3,373,198.77 ±3.44% +3.12%
zod 5,478,188.77 ±10.44% 3,363,198.77 ±3.44% +0.12%
Lorem ipsum valibot 3,373.77 ±3.44% 3,373,198.77 ±3.44% +3.12%
Lorem ipsum dolor sit amet valibot 3,373.77 ±3.44% 3,373,198.77 ±3.44% -3.12%
Lorem valibot 3,373,198.77 ±3.44%
zod 5,478,188.77 ±10.44%

[!NOTE]
hz – the number of operations per second (higher – better)
rme – relative margin of error

Full log and details of before and after benchmark lunch.


The table contains descriptions of tests that contains variants to compare. Variants are sorted by rank (desc sort by after hz value). The negative difference in test results are marked with bold font. If test contains variant, that wasn't present in main branch, its results will be empty. Tests are separated by empty row in the table.

Currently, the workflow will fail, because there aren't any benchmarks in main branch and vitest will fail with exit code 1. The pr #99 solves the problem.

Also the workflow will always be awaiting approval from author to start on every pull request.

@netlify
Copy link

netlify bot commented Aug 13, 2023

Deploy Preview for valibot canceled.

Name Link
🔨 Latest commit ffcb46a
🔍 Latest deploy log https://app.netlify.com/sites/valibot/deploys/64d96e6c0fb77100084b6c6a

@fabian-hiller fabian-hiller self-assigned this Aug 14, 2023
@fabian-hiller fabian-hiller added enhancement New feature or request github GitHub related changes labels Aug 14, 2023
@fabian-hiller
Copy link
Owner

Thank you very much! The next few days I have to focus on my bachelor thesis. As soon as I find time, I'll get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request github GitHub related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants