From 106dbcea624521b02f3f3adbc6fe23e35eed2bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20R=C3=BCth?= Date: Tue, 17 Oct 2023 22:59:52 +0300 Subject: [PATCH 1/3] Run benchmarks in CI --- .github/workflows/benchmark.yml | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 00000000..f1639391 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,48 @@ +name: Benchmark +on: + push: { branches: [ "master" ] } + pull_request: { branches: [ "master" ] } + +jobs: + asv: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - uses: conda-incubator/setup-miniconda@v2 + with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" } + - name: Install dependencies + shell: bash -l {0} + run: | + mamba env update --quiet -n test -f libeantic/environment.yml + conda list + - name: Checkout historic performance data + uses: actions/checkout@v2 + with: + path: .asv/results + ref: asv + - name: Run benchmarks + uses: flatsurf/actions/asv@main + - name: Update historic performance data + uses: EndBug/add-and-commit@v5 + with: + author_name: asv bot + author_email: bot@flatsurf.org + message: 'record asv run' + cwd: .asv/results + branch: asv + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event_name == 'push' }} + - uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: .asv/html + TARGET_FOLDER: asv + if: ${{ github.event_name == 'push' }} + +env: + MAKEFLAGS: -j2 From 7a96e97336344d865f68e5fe5d4c5c75de89bd23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20R=C3=BCth?= Date: Tue, 17 Oct 2023 23:07:23 +0300 Subject: [PATCH 2/3] Add configuration for ASV --- asv.conf.json | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 asv.conf.json diff --git a/asv.conf.json b/asv.conf.json new file mode 100644 index 00000000..685379c1 --- /dev/null +++ b/asv.conf.json @@ -0,0 +1,36 @@ +{ + "version": 1, + "dvcs": "git", + "project": "e-antic", + "project_url": "https://github.com/flatsurf/e-antic", + "show_commit_url": "https://github.com/flatsurf/e-antic/commit/", + "repo": ".", + "environment_type": "conda", + "matrix": { + "arb": [], + "automake": [], + "benchmark==1.5.0": [], + "boost-cpp": [], + "ccache": [], + "flatsurf::cppasv": [], + "cxx-compiler": [], + "gmp": [], + "libtool": [], + "make": [] + }, + "conda_channels": ["conda-forge"], + "repo_subdir": "libeantic", + "build_command": [ + "autoreconf -ivf", + "/bin/sh configure CXX='ccache c++'", + "make" + ], + "install_command": [], + "uninstall_command": [], + "benchmark_dir": "tools/asv", + "env_dir": ".asv/env", + "results_dir": ".asv/results", + "html_dir": ".asv/html" +} + + From 4f9ce2bfbe7daab76ea8c7a2394e5d9101f6ff5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20R=C3=BCth?= Date: Tue, 17 Oct 2023 23:10:15 +0300 Subject: [PATCH 3/3] Add asv helper from flatsurf/tools --- tools/asv/.gitignore | 1 + tools/asv/__init__.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tools/asv/.gitignore create mode 100644 tools/asv/__init__.py diff --git a/tools/asv/.gitignore b/tools/asv/.gitignore new file mode 100644 index 00000000..225fc6f6 --- /dev/null +++ b/tools/asv/.gitignore @@ -0,0 +1 @@ +/__pycache__ diff --git a/tools/asv/__init__.py b/tools/asv/__init__.py new file mode 100644 index 00000000..7c734961 --- /dev/null +++ b/tools/asv/__init__.py @@ -0,0 +1,34 @@ +#********************************************************************* +# This file is part of e-antic. +# +# Copyright (C) 2019-2023 Julian RĂ¼th +# +# e-antic is free software: you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation, either version 3.0 of the License, or (at your option) +# any later version. +# +# e-antic is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License +# along with e-antic. If not, see . +#********************************************************************* + +import os +from os.path import join + +from cppasv import create_wrappers + +ASV_PROJECT_DIR = os.environ.get('ASV_PROJECT_DIR', None) + +if not ASV_PROJECT_DIR: + ASV_ENV_DIR = os.environ.get('ASV_ENV_DIR', None) + if ASV_ENV_DIR: + ASV_PROJECT_DIR = join(ASV_ENV_DIR, "project") + else: + ASV_PROJECT_DIR = join(os.path.dirname(os.path.abspath(__file__)), "..", "..") + +locals().update(create_wrappers(join(ASV_PROJECT_DIR, "libeantic", "benchmark", "benchmark")))