File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -41,19 +41,39 @@ jobs:
41
41
if : steps.cache-py.outputs.cache-hit != 'true'
42
42
43
43
- name : install rust stable
44
+ id : rust-toolchain
44
45
uses : dtolnay/rust-toolchain@stable
46
+ with :
47
+ components : llvm-tools
45
48
46
49
- name : cache rust
47
50
uses : Swatinem/rust-cache@v2
48
51
49
- - name : Install pydantic-core
52
+ - name : Compile pydantic-core for profiling
53
+ # build-prod does not include MiMalloc because it bypasses Maturin
54
+ run : |
55
+ pip install -e .
56
+ make build-prod
57
+ python -c 'import pydantic_core'
58
+ env :
59
+ CONST_RANDOM_SEED : 0 # Fix the compile time RNG seed
60
+ RUSTFLAGS : " -Cprofile-generate=${{ github.workspace }}/profdata"
61
+
62
+ - name : Gather pgo data
63
+ run : pytest
64
+
65
+ - name : Prepare merged pgo data
66
+ run : rustup run stable bash -c '$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata'
67
+
68
+ - name : Compile pydantic-core for benchmarking
50
69
# build-prod does not include MiMalloc because it bypasses Maturin
51
70
run : |
52
71
pip install -e .
53
72
make build-prod
54
73
python -c 'import pydantic_core'
55
74
env :
56
75
CONST_RANDOM_SEED : 0 # Fix the compile time RNG seed
76
+ RUSTFLAGS : " -Cprofile-use=${{ github.workspace }}/merged.profdata"
57
77
58
78
# this is required so that pytest uses the installed package
59
79
- run : rm tests/__init__.py
You can’t perform that action at this time.
0 commit comments