Skip to content

Commit

Permalink
Compile baseline/target revisions w/ mypyc
Browse files Browse the repository at this point in the history
Should help cut runtime by 20-45% :fingers_crossed:
  • Loading branch information
ichard26 committed Jan 14, 2022
1 parent 90a5ec4 commit 298a4ce
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/mypyc-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mypy == 0.920

# A bunch of packages for type information
mypy-extensions >= 0.4.3
tomli >= 0.10.2
types-typed-ast >= 1.4.2
types-dataclasses >= 0.1.3
typing-extensions > 3.10.0.1
click >= 8.0.0
platformdirs >= 2.1.0

# And because build isolation is disabled, we'll need to pull this too
setuptools-scm[toml] >= 6.3.1
wheel
20 changes: 16 additions & 4 deletions .github/workflows/diff_shades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
analysis:
name: analysis / linux
runs-on: ubuntu-latest
env:
# Clang is less picky with the C code it's given than gcc (and may
# generate faster binaries too).
CC: clang-12
MYPYC_OPT_LEVEL: 2

steps:
- name: Checkout this repository (full clone)
Expand All @@ -49,6 +54,7 @@ jobs:
python -m pip install pip --upgrade
python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
python -m pip install click packaging urllib3
python -m pip install -r .github/mypyc-requirements.txt
# After checking out old revisions, this might not exist so we'll use a copy.
cat scripts/diff_shades_gha_helper.py > helper.py
git config user.name "diff-shades-gha"
Expand All @@ -70,22 +76,28 @@ jobs:
path: ${{ steps.config.outputs.baseline-analysis }}
key: ${{ steps.config.outputs.baseline-cache-key }}

- name: Install baseline revision
- name: Build and install baseline revision
if: steps.baseline-cache.outputs.cache-hit != 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: ${{ steps.config.outputs.baseline-setup-cmd }} && python -m pip install .
run: >
${{ steps.config.outputs.baseline-setup-cmd }}
&& python setup.py --use-mypyc bdist_wheel
&& python -m pip install dist/*.whl && rm build dist -r
- name: Analyze baseline revision
if: steps.baseline-cache.outputs.cache-hit != 'true'
run: >
diff-shades analyze -v --work-dir projects-cache/
${{ steps.config.outputs.baseline-analysis }} -- ${{ github.event.inputs.baseline-args }}
- name: Install target revision
- name: Build and install target revision
env:
GITHUB_TOKEN: ${{ github.token }}
run: ${{ steps.config.outputs.target-setup-cmd }} && python -m pip install .
run: >
${{ steps.config.outputs.target-setup-cmd }}
&& python setup.py --use-mypyc bdist_wheel
&& python -m pip install dist/*.whl
- name: Analyze target revision
run: >
Expand Down

0 comments on commit 298a4ce

Please sign in to comment.