detached eb2657a

test(bench): pick the deltified benchmark objects by chain end and delta status (GO-006)

The size filter excluded every delta of the generated fixture, so the
deltified objects silently fell back to a plain packed blob. Select on the
delta flag and the chainEnd type only, and fail when none qualifies.
commit
eb2657acd9c0c0b172112e3f9a11bd2dbff7d589
author
brice · · 2026-10-10 22:15 UTC
parent
b1a375f
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +10 -11
M bench_test.go +10 -11
@@ -125,8 +125,13 @@ func (fx *benchFixture) finish(b *testing.B, gitDir string) {
125125 var id ObjectID
126126 copy(id[:], p.idx.id(i))
127127 switch {
128- case h.isDelta() && h.size > 200:
129- typ, _ := p.chainEnd(off, h)
128+ case h.isDelta():
129+ // The size of a delta is that of the delta, not of the
130+ // object: do not filter on it.
131+ typ, err := p.chainEnd(off, h)
132+ if err != nil {
133+ b.Fatal(err)
134+ }
130135 if typ == TypeBlob && fx.deltaBlob.IsZero() {
131136 fx.deltaBlob = id
132137 }
@@ -146,15 +151,9 @@ func (fx *benchFixture) finish(b *testing.B, gitDir string) {
146151 if fx.looseBlob.IsZero() {
147152 fx.looseBlob = fx.packedBlob
148153 }
149- if fx.deltaBlob.IsZero() {
150- fx.deltaBlob = fx.packedBlob
151- }
152- if fx.deltaTree.IsZero() {
153- var c Commit
154- if err := fx.r.ReadCommit(fx.headCommit, &c); err != nil {
155- b.Fatal(err)
156- }
157- fx.deltaTree = c.Tree
154+ if fx.deltaBlob.IsZero() || fx.deltaTree.IsZero() {
155+ b.Fatalf("no deltified blob (%v) or tree (%v) in the packs of %s: the deltified benchmarks would measure something else",
156+ !fx.deltaBlob.IsZero(), !fx.deltaTree.IsZero(), gitDir)
158157 }
159158 if fx.bigTree.IsZero() {
160159 var c Commit
@@ -125,8 +125,13 @@ func (fx *benchFixture) finish(b *testing.B, gitDir string) {
125 var id ObjectID125 var id ObjectID
126 copy(id[:], p.idx.id(i))126 copy(id[:], p.idx.id(i))
127 switch {127 switch {
128- case h.isDelta() && h.size > 200:128+ case h.isDelta():
129- typ, _ := p.chainEnd(off, h)129+ // The size of a delta is that of the delta, not of the
130+ // object: do not filter on it.
131+ typ, err := p.chainEnd(off, h)
132+ if err != nil {
133+ b.Fatal(err)
134+ }
130 if typ == TypeBlob && fx.deltaBlob.IsZero() {135 if typ == TypeBlob && fx.deltaBlob.IsZero() {
131 fx.deltaBlob = id136 fx.deltaBlob = id
132 }137 }
@@ -146,15 +151,9 @@ func (fx *benchFixture) finish(b *testing.B, gitDir string) {
146 if fx.looseBlob.IsZero() {151 if fx.looseBlob.IsZero() {
147 fx.looseBlob = fx.packedBlob152 fx.looseBlob = fx.packedBlob
148 }153 }
149- if fx.deltaBlob.IsZero() {154+ if fx.deltaBlob.IsZero() || fx.deltaTree.IsZero() {
150- fx.deltaBlob = fx.packedBlob155+ b.Fatalf("no deltified blob (%v) or tree (%v) in the packs of %s: the deltified benchmarks would measure something else",
151- }156+ !fx.deltaBlob.IsZero(), !fx.deltaTree.IsZero(), gitDir)
152- if fx.deltaTree.IsZero() {
153- var c Commit
154- if err := fx.r.ReadCommit(fx.headCommit, &c); err != nil {
155- b.Fatal(err)
156- }
157- fx.deltaTree = c.Tree
158 }157 }
159 if fx.bigTree.IsZero() {158 if fx.bigTree.IsZero() {
160 var c Commit159 var c Commit

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 2

↑↓ moveenter openesc close