mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Expand the baseline benchmark a little
This commit is contained in:
parent
bcd7ac7704
commit
e0e19a934f
2 changed files with 37 additions and 13 deletions
|
@ -339,20 +339,42 @@ func TestBenchmarkBaseline(t *testing.T) {
|
|||
}
|
||||
|
||||
func BenchmarkBaseline(b *testing.B) {
|
||||
cfg := IntegrationTestConfig{
|
||||
T: b,
|
||||
TxtarString: benchmarkBaselineFiles(),
|
||||
}
|
||||
builders := make([]*IntegrationTestBuilder, b.N)
|
||||
b.Run("withrender", func(b *testing.B) {
|
||||
cfg := IntegrationTestConfig{
|
||||
T: b,
|
||||
TxtarString: benchmarkBaselineFiles(),
|
||||
}
|
||||
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()
|
||||
}
|
||||
})
|
||||
|
||||
b.Run("skiprender", func(b *testing.B) {
|
||||
cfg := IntegrationTestConfig{
|
||||
T: b,
|
||||
TxtarString: benchmarkBaselineFiles(),
|
||||
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()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func benchmarkBaselineFiles() string {
|
||||
|
|
|
@ -207,7 +207,7 @@ func (s *IntegrationTestBuilder) BuildE() (*IntegrationTestBuilder, error) {
|
|||
return s, err
|
||||
}
|
||||
|
||||
err := s.build(BuildCfg{})
|
||||
err := s.build(s.Cfg.BuildCfg)
|
||||
return s, err
|
||||
}
|
||||
|
||||
|
@ -503,4 +503,6 @@ type IntegrationTestConfig struct {
|
|||
NeedsNpmInstall bool
|
||||
|
||||
WorkingDir string
|
||||
|
||||
BuildCfg BuildCfg
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue