Skip to content

Commit 62e1239

Browse files
committed
Use smaller test counts to reduce CI time while still detecting regression
Changed from (10, 100, 1000) to (10, 50, 200) values. Since the bug scales exponentially, 200 values is sufficient to prove the optimization works (without fix: 16s+, with fix: 150ms). Benefits: - Test runs in ~1-2s instead of 25-65s on CI with race detector - Still catches performance regressions (10x+ speedup is obvious) - More reliable on slow/variable CI runners - Faster local development feedback Verified on: - Go 1.24.5 without race: 0.5ms, 11ms, 152ms ✓ - Go 1.24.5 with race: 3.2ms, 68ms, 916ms ✓ - Go 1.17.13 with race: 3.7ms, 71ms, 1.07s ✓
1 parent b36b5d2 commit 62e1239

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

decoder_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,8 @@ func TestIssue71NestedPerformance(t *testing.T) {
19571957

19581958
// Adjust thresholds based on race detector
19591959
// Race detector adds 5-10x overhead, especially on older Go versions
1960+
// Using smaller counts (10, 50, 200) since we know the bug scales exponentially.
1961+
// Without the fix, even 200 values would take 10+ seconds.
19601962
var thresholds []struct {
19611963
numValues int
19621964
maxTime time.Duration
@@ -1970,8 +1972,8 @@ func TestIssue71NestedPerformance(t *testing.T) {
19701972
maxTime time.Duration
19711973
}{
19721974
{10, 50 * time.Millisecond},
1973-
{100, 500 * time.Millisecond},
1974-
{1000, 50 * time.Second}, // Extra lenient for slow CI runners
1975+
{50, 500 * time.Millisecond}, // Without fix: ~5s, with fix: ~50-100ms
1976+
{200, 5 * time.Second}, // Without fix: ~80s+, with fix: ~500ms-2s
19751977
}
19761978
} else {
19771979
// Strict thresholds for normal mode (local dev)
@@ -1981,8 +1983,8 @@ func TestIssue71NestedPerformance(t *testing.T) {
19811983
maxTime time.Duration
19821984
}{
19831985
{10, 10 * time.Millisecond},
1984-
{100, 100 * time.Millisecond},
1985-
{1000, 10 * time.Second},
1986+
{50, 50 * time.Millisecond}, // Without fix: ~1s, with fix: ~5-10ms
1987+
{200, 500 * time.Millisecond}, // Without fix: ~16s, with fix: ~50-100ms
19861988
}
19871989
}
19881990

0 commit comments

Comments
 (0)