File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,17 +148,10 @@ func TestNarrowMultiDeclarator(t *testing.T) {
148148}
149149
150150// TestAttributeSymbols_ScalesLinearlyInDeclarations guards the shape of the
151- // containment work, not an absolute duration: exclusiveText and the
152- // nested-region test both used to rescan every sibling region for every
153- // region, which is quadratic in declaration count. A generated file of
154- // 16 000 declarations took seconds where `git diff --numstat` takes none.
155- // Region nesting is now resolved once (buildRegionTree), so 16x the
156- // declarations costs about 16x the time rather than 256x.
157- //
158- // The bound is deliberately loose -- a ratio, with the minimum of several
159- // runs, so a loaded machine inflating both measurements cancels out. The old
160- // quadratic code measured well above 30x here; the linear walk comfortably
161- // below it.
151+ // containment work, not an absolute duration: a per-region sibling rescan
152+ // is quadratic in declaration count, so region nesting is resolved once
153+ // (buildRegionTree). The bound is a ratio, taking the minimum of several
154+ // runs, so a loaded machine inflating both measurements cancels out.
162155func TestAttributeSymbols_ScalesLinearlyInDeclarations (t * testing.T ) {
163156 t .Parallel ()
164157 lang , ok := resolve .ForExtension (".go" )
Original file line number Diff line number Diff line change @@ -1143,10 +1143,10 @@ func TestRun_StagedRenameAcrossDirectoryDepth(t *testing.T) {
11431143
11441144// TestRun_ZeroCountChangeIsNotAModeRow pins the classification of a change
11451145// git reports with 0 added / 0 deleted that is not a mode edit: a staged pure
1146- // rename and an added empty file both used to render as "mode 644->644" (and
1147- // "?->644" for the empty addition), with no row naming the move at all. Only
1148- // a genuine mode disagreement is a MODE row; everything else keeps a row of
1149- // its own at the path git lists it under.
1146+ // rename and an added empty file keep a named row, never "mode 644->644"
1147+ // (or "?->644" for the empty addition). Only a genuine mode disagreement is a
1148+ // MODE row; everything else keeps a row of its own at the path git lists it
1149+ // under.
11501150func TestRun_ZeroCountChangeIsNotAModeRow (t * testing.T ) {
11511151 t .Parallel ()
11521152
Original file line number Diff line number Diff line change 4141)
4242
4343// fixtureTemplate is a git template directory carrying the two things every
44- // fixture repository needs, which used to cost four `git config`
44+ // fixture repository needs, so New does not pay four `git config`
4545// subprocesses per repository:
4646//
4747// - user.name/user.email, so a repository created off it can commit
Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ func readCount(t *testing.T, countFile string) int64 {
4141}
4242
4343// TestNewCostsOneGitProcess pins the fixture's own cost: a repository built
44- // by New must come from the template in a single `git init`, not from the
45- // four `git config` invocations it used to take to write the same settings
46- // afterwards. Those four were the largest single block of subprocesses in
47- // the unit lane, so a regression here is a slow suite, not a failing one.
44+ // by New must come from the template in a single `git init`, not from four
45+ // `git config` invocations afterwards. Those four would be the largest
46+ // single block of subprocesses in the unit lane, so a regression here is a
47+ // slow suite, not a failing one.
4848func TestNewCostsOneGitProcess (t * testing.T ) {
4949 bin , countFile := countingGit (t )
5050 t .Setenv ("PATH" , bin )
You can’t perform that action at this time.
0 commit comments