| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4ecabd1 commit 2edf913
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -118,8 +118,8 @@ counter is 30,899 because the import-time Git probe precedes pytest session | |||
| 118 | 118 | accounting. The same run recorded 21,409 fallback decisions. These totals | |
| 119 | 119 | include explicit CLI tests and fixture commands, including non-Git commands | |
| 120 | 120 | passed directly to `Git.execute`; they are a local baseline, not a count of | |
| 121 | - only fallback calls. The fixed warm benchmark instead isolates a user journey: | ||
| 122 | - 23 CLI launches versus one Gix launch, opening nine versus one, and nested | ||
| 121 | + only fallback calls. The expanded warm benchmark instead isolates a user journey: | ||
| 122 | + 43 CLI launches versus one Gix launch, opening nine versus one, and nested | ||
| 123 | 123 | discovery eleven versus three after restoring the reference-format fallback | |
| 124 | 124 | and sharing successful version checks. | |
| 125 | 125 | The historical full-suite counts above predate this correction. A constant | |
@@ -195,14 +195,19 @@ environment metadata. | |||
| 195 | 195 | ### Existing-repository benchmark | |
| 196 | 196 | ||
| 197 | 197 | [`test/performance/README.md`](../test/performance/README.md) describes the | |
| 198 | - `pyperf` harness and fixed GitPython 3.1.45 fixture. It measures eight public-API | ||
| 198 | + `pyperf` harness and fixed GitPython 3.1.45 fixture. It measures eleven public-API | ||
| 199 | 199 | operations and their complete journey on one already-open `git.Repo`, plus | |
| 200 | 200 | separate direct opening and discovery from `git/objects`. Fresh high-level | |
| 201 | 201 | wrappers preserve the cost of actual operations; imports, fixture preparation | |
| 202 | 202 | and parity preflight are outside timing. Native repository refresh remains | |
| 203 | 203 | inside operation timing, so these measurements include the cost of keeping | |
| 204 | 204 | retained state current. | |
| 205 | 205 | ||
| 206 | + Submodule inventory, revision path/mode lookup and raw commit/tree readback | ||
| 207 | + extend the already-open journey, each with a zero-CLI ceiling. The readback | ||
| 208 | + measurement reads existing bytes, including the signed fixture commit, without | ||
| 209 | + rewriting objects. Historical tables below retain their original workloads. | ||
| 210 | + | ||
| 206 | 211 | At `244e418da6cc43de129cbe2908d11be4c5ad457a`, using official GixPython | |
| 207 | 212 | 0.1.0 and the same existing CPython 3.12.14/macOS arm64 interpreter for both | |
| 208 | 213 | installations, with Git 2.54.0 (Apple Git-157), six worker processes with three values each produced the | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | # Backend benchmark | |
| 2 | 2 | ||
| 3 | 3 | `bench_repository.py` uses `pyperf` to measure a complete read-only journey and | |
| 4 | - eight named operations against an existing repository, plus separate direct | ||
| 4 | + eleven named operations against an existing repository, plus separate direct | ||
| 5 | 5 | opening and nested-directory discovery measurements. It keeps one `Repo` | |
| 6 | 6 | instance open per worker, but creates fresh commit/tree/index wrappers per | |
| 7 | 7 | invocation so their cached properties cannot turn the measurement into a no-op. | |
@@ -72,6 +72,12 @@ at least one parent, a root `README.md` and a `git/objects` directory for the | |||
| 72 | 72 | nested discovery measurement. The harness never prepares or | |
| 73 | 73 | mutates that worktree, and ignores ambient Git environment/config overrides. | |
| 74 | 74 | ||
| 75 | + The journey also enumerates submodules, resolves tree/index revisions with | ||
| 76 | + their paths and modes, and reads raw commit/tree bytes through the object | ||
| 77 | + database. The last operation covers serialization readback without rewriting | ||
| 78 | + objects; the pinned fixture's signed commit remains intact. These three | ||
| 79 | + measurements have zero-CLI ceilings and join the existing CI job automatically. | ||
| 80 | + | ||
| 75 | 81 | Add a function returning JSON-compatible results to `MEASUREMENTS` in | |
| 76 | 82 | `bench_repository.py`. It automatically becomes a separate benchmark and part | |
| 77 | 83 | of the journey and parity checks. Include supported and fallback operations; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,6 +44,21 @@ def index(repo): | |||
| 44 | 44 | return sorted([path, stage, entry.mode, entry.hexsha] for (path, stage), entry in repo.index.entries.items()) | |
| 45 | 45 | ||
| 46 | 46 | ||
| 47 | + def submodules(repo): | ||
| 48 | + return [[module.name, module.path, module.hexsha, module.url, module.branch_path] for module in repo.submodules] | ||
| 49 | + | ||
| 50 | + | ||
| 51 | + def revision_paths(repo): | ||
| 52 | + objects = [repo.rev_parse(revision) for revision in ("HEAD:README.md", "HEAD:git", ":README.md")] | ||
| 53 | + return [[obj.hexsha, obj.path, obj.mode] for obj in objects] | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + def object_readback(repo): | ||
| 57 | + commit = repo.commit("HEAD") | ||
| 58 | + # Read the same bytes used by serialization, without writing objects or stripping signatures. | ||
| 59 | + return [sha256(obj.data_stream.read()).hexdigest() for obj in (commit, commit.tree)] | ||
| 60 | + | ||
| 61 | + | ||
| 47 | 62 | def graph(repo): | |
| 48 | 63 | tip, parent = repo.commit("HEAD"), repo.commit("HEAD~1") | |
| 49 | 64 | return { | |
@@ -81,6 +96,9 @@ def worktree(repo): | |||
| 81 | 96 | "history_25": history, | |
| 82 | 97 | "browse_tree_and_blob": browse, | |
| 83 | 98 | "read_index": index, | |
| 99 | + "submodule_inventory": submodules, | ||
| 100 | + "revision_paths": revision_paths, | ||
| 101 | + "object_readback": object_readback, | ||
| 84 | 102 | "revision_graph": graph, | |
| 85 | 103 | "diff_and_stats": changes, | |
| 86 | 104 | "patch_diff": patch, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,9 @@ | |||
| 6 | 6 | "history_25": 0, | |
| 7 | 7 | "browse_tree_and_blob": 0, | |
| 8 | 8 | "read_index": 0, | |
| 9 | + "submodule_inventory": 0, | ||
| 10 | + "revision_paths": 0, | ||
| 11 | + "object_readback": 0, | ||
| 9 | 12 | "revision_graph": 0, | |
| 10 | 13 | "diff_and_stats": 0, | |
| 11 | 14 | "patch_diff": 1, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments