Skip to content

Commit

Permalink
Add performance testing setup to Kedro (#4172)
Browse files Browse the repository at this point in the history
* Add asv test setup

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>

* lint

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>

---------

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
  • Loading branch information
ankatiyar authored Sep 23, 2024
1 parent 86f9304 commit a268b97
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/benchmark-performance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ASV Benchmark

on:
push:
branches:
- main # Run benchmarks on every commit to the main branch
workflow_dispatch:


jobs:

benchmark:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: "kedro"

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install asv # Install ASV
- name: Run ASV benchmarks
run: |
cd kedro
asv machine --machine=github-actions
asv run -v --machine=github-actions
- name: Set git email and name
run: |
git config --global user.email "kedro@kedro.com"
git config --global user.name "Kedro"
- name: Checkout target repository
uses: actions/checkout@v4
with:
repository: kedro-org/kedro-benchmark-results
token: ${{ secrets.GH_TAGGING_TOKEN }}
ref: 'main'
path: "kedro-benchmark-results"

- name: Copy files to target repository
run: |
cp -r /home/runner/work/kedro/kedro/kedro/.asv /home/runner/work/kedro/kedro/kedro-benchmark-results/
- name: Commit and Push changes to kedro-org/kedro-benchmark-results
run: |
cd kedro-benchmark-results
git add .
git commit -m "Add results"
git push
12 changes: 12 additions & 0 deletions asv.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"project": "Kedro",
"project_url": "https://kedro.org/",
"repo": ".",
"install_command": ["pip install -e ."],
"branches": ["main"],
"environment_type": "virtualenv",
"show_commit_url": "http://github.com/kedro-org/kedro/commit/",
"results_dir": ".asv/results",
"html_dir": ".asv/html"
}
Empty file added benchmarks/__init__.py
Empty file.
16 changes: 16 additions & 0 deletions benchmarks/benchmark_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Write the benchmarking functions here.
# See "Writing benchmarks" in the asv docs for more information.


class TimeSuite:
"""
A dummy benchmark suite to test with asv framework.
"""
def setup(self):
self.d = {}
for x in range(500):
self.d[x] = None

def time_keys(self):
for key in self.d.keys():
pass

0 comments on commit a268b97

Please sign in to comment.