-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add performance testing setup to Kedro (#4172)
* 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
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |