Commit 4567562
authored
deps: libvcs 0.30.0 -> 0.33.0 (test performance improved)
# Problem
Git, Subversion, and Mercurial repositories are unnecessarily reinitialized for each test via libvcs' pytest plugin.
- We're not utilizing session-based scoping.
- A single initial repo could be created, then copied to [`tmp_path`](https://docs.pytest.org/en/8.3.x/how-to/tmp_path.html#the-tmp-path-fixture) using [`shutil.copytree`](https://docs.python.org/3/library/shutil.html#shutil.copytree) ([source](https://github.com/python/cpython/blob/v3.13.0/Lib/shutil.py#L550-L605)).
# Improvement
```
❯ hyperfine \
--warmup 3 \
--runs 10 \
--prepare 'pip uninstall -y libvcs && pip install "libvcs==0.30.1"' \
--command-name 'libvcs 0.30.1' \
'py.test' \
--prepare 'pip uninstall -y libvcs && pip install "libvcs==0.31.0"' \
--command-name 'libvcs 0.31.0' \
'py.test' \
--prepare 'pip uninstall -y libvcs && pip install "libvcs==0.32.1"' \
--command-name 'libvcs 0.32.1' \
'py.test'
Benchmark 1: libvcs 0.30.1
Time (mean ± σ): 4.784 s ± 0.116 s [User: 4.641 s, System: 0.846 s]
Range (min … max): 4.599 s … 4.971 s 10 runs
Benchmark 2: libvcs 0.31.0
Time (mean ± σ): 3.436 s ± 0.115 s [User: 2.821 s, System: 0.470 s]
Range (min … max): 3.347 s … 3.678 s 10 runs
Benchmark 3: libvcs 0.32.1
Time (mean ± σ): 3.173 s ± 0.054 s [User: 2.726 s, System: 0.388 s]
Range (min … max): 3.104 s … 3.295 s 10 runs
Summary
libvcs 0.32.1 ran
1.08 ± 0.04 times faster than libvcs 0.31.0
1.51 ± 0.04 times faster than libvcs 0.30.1
```
# Changes
## libvcs 0.30.1 -> 0.32.1
See also:
- https://github.com/vcs-python/libvcs/blob/v0.32.1/CHANGES#libvcs-0310-2024-10-12
- https://libvcs.git-pull.com/history.html#libvcs-0-32-1-2024-10-12
# Appendix
- vcs-python/libvcs#472File tree
7 files changed
+24
-15
lines changed- tests
7 files changed
+24
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
| 149 | + | |
151 | 150 | | |
152 | 151 | | |
153 | 152 | | |
| |||
252 | 251 | | |
253 | 252 | | |
254 | 253 | | |
255 | | - | |
256 | | - | |
| 254 | + | |
257 | 255 | | |
258 | 256 | | |
259 | | - | |
| 257 | + | |
260 | 258 | | |
261 | 259 | | |
262 | 260 | | |
| |||
0 commit comments