File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,37 @@ 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
+ # --no-default-features to avoid using mimalloc
54
+ run : |
55
+ pip install -e . --config-settings=build-args='--no-default-features --verbose' -v
56
+ python -c 'import pydantic_core; assert pydantic_core._pydantic_core.__pydantic_core_default_allocator__'
57
+ env :
58
+ CONST_RANDOM_SEED : 0 # Fix the compile time RNG seed
59
+ RUSTFLAGS : " -Cprofile-generate=${{ github.workspace }}/profdata"
60
+
61
+ - name : Gather pgo data
62
+ run : pytest
63
+
64
+ - name : Prepare merged pgo data
65
+ 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'
66
+
67
+ - name : Compile pydantic-core for benchmarking
50
68
# --no-default-features to avoid using mimalloc
51
69
run : |
52
70
pip install -e . --config-settings=build-args='--no-default-features --verbose' -v
53
71
python -c 'import pydantic_core; assert pydantic_core._pydantic_core.__pydantic_core_default_allocator__'
54
72
env :
55
73
CONST_RANDOM_SEED : 0 # Fix the compile time RNG seed
74
+ RUSTFLAGS : " -Cprofile-use=${{ github.workspace }}/merged.profdata"
56
75
57
76
- name : Run CodSpeed benchmarks
58
77
uses : CodSpeedHQ/action@v1
You can’t perform that action at this time.
0 commit comments