diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-12-29 15:56:02 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-12-29 15:56:02 +0100 |
commit | abcc61002a1b034425ea563707d735cdfceb8d41 (patch) | |
tree | 0b69c720b70d96a21b2ddb874c1656415b70246e | |
parent | 648d00c7d8243d71e33c33e99a6e4f509beddf98 (diff) |
Simplify baseline benchmark
-rw-r--r-- | hugolib/hugo_smoke_test.go | 68 |
1 files changed, 12 insertions, 56 deletions
diff --git a/hugolib/hugo_smoke_test.go b/hugolib/hugo_smoke_test.go index 28a5a2635..295d15582 100644 --- a/hugolib/hugo_smoke_test.go +++ b/hugolib/hugo_smoke_test.go @@ -339,70 +339,26 @@ func TestBenchmarkBaseline(t *testing.T) { b.Assert(len(b.H.Sites[0].Pages()), qt.Equals, 197) b.Assert(len(b.H.Sites[2].RegularPages()), qt.Equals, 158) b.Assert(len(b.H.Sites[2].Pages()), qt.Equals, 194) - } func BenchmarkBaseline(b *testing.B) { - b.Run("withrender", func(b *testing.B) { - cfg := IntegrationTestConfig{ - T: b, - TxtarString: benchmarkBaselineFiles(false), - } - builders := make([]*IntegrationTestBuilder, b.N) - - for i := range builders { - builders[i] = NewIntegrationTestBuilder(cfg) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - builders[i].Build() - } - }) - - b.Run("skiprender", func(b *testing.B) { - cfg := IntegrationTestConfig{ - T: b, - TxtarString: benchmarkBaselineFiles(false), - BuildCfg: BuildCfg{ - SkipRender: true, - }, - } - builders := make([]*IntegrationTestBuilder, b.N) - - for i := range builders { - builders[i] = NewIntegrationTestBuilder(cfg) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - builders[i].Build() - } - }) - - b.Run("skiprender leaf", func(b *testing.B) { - cfg := IntegrationTestConfig{ - T: b, - TxtarString: benchmarkBaselineFiles(false), - BuildCfg: BuildCfg{ - SkipRender: true, - }, - } - builders := make([]*IntegrationTestBuilder, b.N) + cfg := IntegrationTestConfig{ + T: b, + TxtarString: benchmarkBaselineFiles(false), + } + builders := make([]*IntegrationTestBuilder, b.N) - for i := range builders { - builders[i] = NewIntegrationTestBuilder(cfg) - } + for i := range builders { + builders[i] = NewIntegrationTestBuilder(cfg) + } - b.ResetTimer() - for i := 0; i < b.N; i++ { - builders[i].Build() - } - }) + b.ResetTimer() + for i := 0; i < b.N; i++ { + builders[i].Build() + } } func benchmarkBaselineFiles(leafBundles bool) string { - rnd := rand.New(rand.NewSource(32)) files := ` |