You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce53306
Browse filesBrowse the repository at this point in the historyBrowse files
docs: record fixture optimization validation and suite timings
Update the performance journal now that repeated test setup has been reduced
in seven independent commits. Describe copied writable state, stable-path
restoration for absolute Git links, lazy historical sources, and direct tree
reads, retaining native repository reuse as future work.
Record affected GixPython-first and CLI-second validation, isolation checks,
and the complete coverage-enabled runs at `c8ee26c7`: GixPython passed in
404.61 seconds versus the previous 757.85 seconds (46.6% less time); CLI
passed in 755.78 seconds. Distinguish this local before/after observation from
a statistical benchmark and explain the differing backend test counts.
Repository-wide Ruff lint/format, mypy, and pyright checks passed.
| 166 |`TExc` (157) and `TestActor` (9) inherit repository-building `TestBase`. | Use a base without repository setup; these assertions need no repository. |
165
-
| 182 | Three submodule rejection bodies repeatedly build `movable_submodule`, then check snapshots for no mutation. | Share one committed baseline, with fresh Python wrappers and per-case temporary paths. |
166
-
| 51 | Six submodule rejection bodies prepare nested metadata, separate metadata, intermediate/leaf symlinks, or retained metadata before checking rejection. | Prepare immutable variants once; group by layout rather than repeating setup for every operation or spelling. |
167
-
| 15 | Eight revision-query bodies rebuild the same four-commit graph, refs, index, and reflogs through `rev_parse_repo`. | Share the prepared graph; keep the five mutating cases isolated. |
168
-
| 8 | Tree lookup bodies clone and check out `0.3.2.1` through `with_rw_repo`. | Share one prepared historical repository; the assertions only read trees. |
169
-
170
-
Thus at least 256 repository-using cases are initial sharing candidates,
171
-
alongside 166 cases where repository setup could disappear. They could
172
-
plausibly use about 14 prepared scenarios: one ordinary submodule baseline,
173
-
11 rejection-layout variants, one revision graph and one historical tree
174
-
baseline. That scenario count is an implementation estimate, not validated
175
-
fixture sharing. The full
176
-
`movable_submodule` fixture is constructed for 322 cases and `local_submodule`
177
-
for 68 cases. Even mutating cases could start from prepared filesystem copies,
178
-
with writable refs, index, config, worktree and submodule metadata isolated;
179
-
their shared object data and source repositories must remain immutable.
180
-
Snapshot/copy cost and path relocation need measurement before choosing a
181
-
strategy. Do not hard-link mutable Git metadata or rely on resetting only
182
-
`HEAD` to restore a fixture.
183
-
184
-
Additionally, all 25 collected `TestBase` classes reconstruct both historical
185
-
dependency repositories, including checkouts and `git gc`: 50 constructions.
186
-
Only four classes call the dependency-source helpers. Lazily preparing two
187
-
immutable sources once per session could remove 48 of those constructions,
188
-
independently of whether the consuming tests mutate their own repositories.
189
-
190
-
Before widening fixture scope, verify that each candidate preserves refs,
191
-
reflogs, index, configuration, worktree, metadata and source state; distinguish
192
-
harmless cache changes from persistent changes. Keep mutable Python wrappers,
193
-
environment patches and temporary paths isolated. Security rejection tests
194
-
must retain their no-side-effect assertions and pristine starting state, so
195
-
an earlier failure cannot contaminate later results. Profile setup/call/teardown
196
-
and compare warmed runs before claiming a suite-wide improvement.
165
+
| 166 |`TExc` (157) and `TestActor` (9) inherit repository-building `TestBase`. | Use the existing `TestCase` base without repository setup. |
166
+
| 182 | Three submodule rejection bodies repeatedly build `movable_submodule`, then check snapshots for no mutation. | Prepare logical-name baselines once and copy the parent per case, retaining fresh wrappers and independent writable files. |
167
+
| 51 | Six submodule rejection bodies prepare nested metadata, separate metadata, intermediate/leaf symlinks, or retained metadata before checking rejection. | Cache ten prepared layouts and restore complete copies at their original paths, preserving absolute Git links and symlinks. Cleanup removes the active copy even after failure. |
168
+
| 15 | Eight revision-query bodies rebuild the same four-commit graph, refs, index, and reflogs through `rev_parse_repo`. | Prepare the graph once and copy it for every consumer, including mutating cases; recreate repository, branch and commit wrappers. |
169
+
| 8 | Tree lookup bodies clone and check out `0.3.2.1` through `with_rw_repo`. | Read the historical tree directly through the existing class repository, removing clones and checkouts. |
170
+
171
+
The `movable_submodule` baseline also serves mutating cases: all writable
172
+
refs, index, config, objects, worktree and module metadata are filesystem copies,
173
+
while the local clone source remains shared and immutable. The original 322
174
+
consumers no longer repeat repository initialization and submodule cloning.
175
+
The original 68 `local_submodule` cases copy both source and parent from one
176
+
prepared two-commit layout because these tests also mutate the source. The
177
+
fixture relocates all source URLs and records the private URL in parent history
178
+
for `RootModule` comparisons. No mutable Git metadata is hard-linked.
179
+
180
+
Historical dependency sources are now lazy session fixtures. Originally all
181
+
25 `TestBase` classes reconstructed both sources (50 builds), although only four
182
+
classes called the URL helpers. The suite now prepares each needed source once,
183
+
with consuming tests retaining independent writable clones.
184
+
185
+
Four additional checks exercise isolation: edits and refs in movable copies,
186
+
restoration after deliberate mutation with an absolute symlink, private source
187
+
commits, and revision-graph changes. Existing security no-side-effect snapshots
188
+
remain in place. Native repository ownership, invalidation and thread semantics
189
+
remain deferred as described above.
190
+
191
+
Per-change affected tests on existing CPython 3.12.14/macOS arm64 with official
192
+
GixPython 0.1.0, without coverage (wall-clock seconds including runner setup):
193
+
194
+
| Change | Passed cases | GixPython first | CLI second |
195
+
| --- | --- | --- | --- |
196
+
| Repository-free actor/exception tests | 166 | 0.47 s | 0.49 s |
197
+
| Lazy historical sources, all consumers | 206, plus 14 subtests; 6 skipped, 1 xfailed | 90.89 s | 160.82 s |
198
+
| Movable baseline, top-level submodule tests | 333 | 88.63 s | 178.75 s |
199
+
| Prepared rejection variants | 51 | 12.34 s | 26.23 s |
200
+
| Layout restoration check | 1 | 1.33 s | 1.62 s |
201
+
| Prepared revision graph | 23 | 4.39 s | 7.57 s |
202
+
| Historical tree lookups, whole tree module | 22 | 1.66 s | 3.86 s |
203
+
| Prepared no-fetch source and parent | 69 | 56.27 s | 117.52 s |
204
+
205
+
These selections overlap, and their timings are validation records rather than
206
+
isolated before/after benchmarks. The full-suite measurements below provide the
207
+
broader comparison. Only the existing interpreter was used.
208
+
209
+
At `c8ee26c7da373e28cc7ede17ef2eaadd763fcdfc`, the full GixPython suite
210
+
with coverage passed in **404.61 seconds wall-clock (6m45s)**, with pytest
211
+
reporting 404.12 seconds: 1,653 passed, 79 skipped, one expected failure,
212
+
and 38 subtests passed. Coverage remains 90%. Compared with the original
213
+
757.85-second run, this saved 353.24 seconds (46.6%, about 1.87 times faster).
214
+
This is one local before/after run per revision, not a statistical benchmark.
215
+
216
+
The same operation counters now record 102,581 native operations and 21,402
217
+
CLI fallback decisions, down from 114,800 and 39,002 respectively. Raw Git
218
+
calls and child processes remain outside those counters.
219
+
220
+
The subsequent full CLI run with coverage passed in **755.78 seconds
221
+
wall-clock (12m36s)**, with pytest reporting 755.30 seconds: 1,617 passed,
222
+
80 skipped, one expected failure, and 38 subtests passed. CLI coverage is 82%;
223
+
backend-specific tests account for different collection and coverage. This CLI
224
+
run validates the optimized suite; there is no matching pre-change CLI full-run
225
+
measurement here. Repository-wide Ruff lint/format, mypy and pyright passed.
0 commit comments