sweet: remove bleve-query, fogleman-fauxgl, fogleman-pt
These three benchmarks have been fairly low signal and noisy.
Furthermore the fogleman-* benchmarks have some portability issues.
Fixes #58533.
For #58534.
Change-Id: I98b028a61eff2531fa4921852c40aab05f0af2d7
Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/468556
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/sweet/benchmarks/bleve-query/README.md b/sweet/benchmarks/bleve-query/README.md
deleted file mode 100644
index 6776a92..0000000
--- a/sweet/benchmarks/bleve-query/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# bleve-query Benchmark
-
-This directory contains a benchmark that queries a pre-built Bleve search index
-containing a small subset of Wikipedia.
-
-The benchmark is a heavily modified derivative of the
-[bleve-bench](https://github.com/blevesearch/bleve-bench) repository and thus
-partially retains its copyright as well as its Apache 2.0 license.
diff --git a/sweet/benchmarks/bleve-query/main.go b/sweet/benchmarks/bleve-query/main.go
deleted file mode 100644
index a616049..0000000
--- a/sweet/benchmarks/bleve-query/main.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !aix && !plan9
-// +build !aix,!plan9
-
-package main
-
-import (
- "flag"
- "fmt"
- "os"
-
- "golang.org/x/benchmarks/sweet/benchmarks/internal/driver"
-
- "github.com/blevesearch/bleve"
- _ "github.com/blevesearch/bleve/analysis/analyzer/keyword"
-)
-
-var iterations int
-
-func init() {
- flag.IntVar(&iterations, "iterations", 50, "number of times to iterate over the list of query terms")
-}
-
-func parseFlags() error {
- flag.Parse()
- if flag.NArg() != 1 {
- return fmt.Errorf("expected bleve index directory as input")
- }
- return nil
-}
-
-func run(idxdir string, iterations int) error {
- index, err := bleve.Open(idxdir)
- if err != nil {
- return err
- }
- return driver.RunBenchmark("BleveQuery", func(_ *driver.B) error {
- for j := 0; j < iterations; j++ {
- for _, term := range terms {
- query := bleve.NewTermQuery(term)
- query.SetField("Text")
- _, err := index.Search(bleve.NewSearchRequest(query))
- if err != nil {
- return err
- }
- }
- }
- return nil
- }, driver.InProcessMeasurementOptions...)
-}
-
-func main() {
- driver.SetFlags(flag.CommandLine)
- if err := parseFlags(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- if err := run(flag.Arg(0), iterations); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
diff --git a/sweet/benchmarks/bleve-query/terms.go b/sweet/benchmarks/bleve-query/terms.go
deleted file mode 100644
index 56526d1..0000000
--- a/sweet/benchmarks/bleve-query/terms.go
+++ /dev/null
@@ -1,302 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !aix && !plan9
-// +build !aix,!plan9
-
-package main
-
-// TODO(mknyszek): Add more terms, approximately 50x more if possible.
-var terms = []string{
- "water",
- "education",
- "time",
- "pillar",
- "genetics",
- "philosophy",
- "architecture",
- "chemistry",
- "literature",
- "flower",
- "oil",
- "airplane",
- "knowledge",
- "technology",
- "web",
- "programming",
- "physics",
- "economics",
- "garbage",
- "television",
- "history",
- "war",
- "earth",
- "postage",
- "moon",
- "1962",
- "basketball",
- "soccer",
- "waves",
- "ocean",
- "route",
- "infrastructure",
- "benchmark",
- "helmet",
- "bone",
- "corn",
- "taxi",
- "corner",
- "coroner",
- "1981",
- "1555",
- "converse",
- "organization",
- "linear",
- "correspondance",
- "growth",
- "capitalism",
- "communism",
- "show",
- "passion",
- "banana",
- "monday",
- "march",
- "robot",
- "work",
- "email",
- "collection",
- "stamps",
- "1886",
- "providence",
- "intelligence",
- "alien",
- "survival",
- "fear",
- "joy",
- "accordion",
- "tambourine",
- "whale",
- "dance",
- "organism",
- "beautiful",
- "grace",
- "winter",
- "path",
- "strawberry",
- "scarf",
- "head",
- "snow",
- "fall",
- "rss",
- "atomic",
- "hiss",
- "snake",
- "ornery",
- "tedious",
- "interface",
- "application",
- "wikipedia",
- "dictionary",
- "thesaurus",
- "dinosaur",
- "meteor",
- "island",
- "climate",
- "nuclear",
- "fallout",
- "orange",
- "disagreement",
- "shock",
- "lightning",
- "thunder",
- "elemental",
- "substantial",
- "disagreement",
- "agreement",
- "dreams",
- "muscle",
- "apple",
- "trouble",
- "clash",
- "quarrel",
- "quiver",
- "appearance",
- "scarecrow",
- "different",
- "jar",
- "form",
- "style",
- "tin",
- "awkward",
- "sound",
- "june",
- "rubbish",
- "canine",
- "teeth",
- "aquatic",
- "fish",
- "riddance",
- "good",
- "bad",
- "morality",
- "quality",
- "nonsense",
- "dump",
- "superlative",
- "comparison",
- "horrendous",
- "fantastic",
- "excellent",
- "go",
- "return",
- "string",
- "qubit",
- "bit",
- "nibble",
- "standard",
- "colloquial",
- "critic",
- "disparage",
- "denounce",
- "origin",
- "exceed",
- "expect",
- "brain",
- "context",
- "abstract",
- "syntax",
- "tree",
- "arbor",
- "ogre",
- "monster",
- "sweater",
- "clothing",
- "apparel",
- "shoe",
- "foot",
- "meter",
- "metric",
- "ordinary",
- "artificer",
- "stone",
- "granite",
- "composite",
- "gopher",
- "gobble",
- "turkey",
- "cranberry",
- "egg",
- "red",
- "green",
- "yellow",
- "blue",
- "purple",
- "spectrum",
- "light",
- "luigi",
- "space",
- "deep",
- "extravagant",
- "order",
- "prime",
- "optimal",
- "transformer",
- "vehicle",
- "halo",
- "sword",
- "shield",
- "border",
- "land",
- "lord",
- "rent",
- "restore",
- "curative",
- "herb",
- "horror",
- "love",
- "first",
- "dirt",
- "rescue",
- "volcano",
- "avalanche",
- "tornado",
- "disaster",
- "relief",
- "terror",
- "rehabilitation",
- "globe",
- "second",
- "third",
- "direction",
- "honey",
- "bee",
- "thing",
- "escape",
- "hive",
- "horde",
- "heavy",
- "soft",
- "star",
- "sun",
- "gas",
- "astronomy",
- "astrology",
- "distant",
- "speed",
- "velocity",
- "acceleration",
- "mass",
- "delta",
- "alpha",
- "beta",
- "gamma",
- "omega",
- "ray",
- "resistance",
- "revolution",
- "volt",
- "electron",
- "proton",
- "quark",
- "ignite",
- "collide",
- "colloid",
- "suspension",
- "mechanical",
- "force",
- "torsion",
- "centripetal",
- "centrifugal",
- "orbit",
- "jupiter",
- "quantum",
- "quantitative",
- "state",
- "vector",
- "matrix",
- "tensor",
- "calculus",
- "lambda",
- "machine",
- "revolve",
- "spin",
- "superposition",
- "impose",
- "crater",
- "trench",
- "ice",
- "iceberg",
- "arctic",
- "cold",
- "hot",
- "degree",
- "extent",
- "span",
- "molten",
- "core",
- "surge",
- "tectonic",
- "plate",
- "fascinate",
-}
diff --git a/sweet/benchmarks/fogleman-fauxgl/README.md b/sweet/benchmarks/fogleman-fauxgl/README.md
deleted file mode 100644
index 152172a..0000000
--- a/sweet/benchmarks/fogleman-fauxgl/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# fogleman-fauxgl Benchmark
-
-This directory contains a benchmark of Michael Fogleman's FauxGL library which
-is an OpenGL-esque software rendering pipeline implemented in pure Go. It
-renders a given input mesh 72 times, rotating it by 5 degrees each time.
diff --git a/sweet/benchmarks/fogleman-fauxgl/main.go b/sweet/benchmarks/fogleman-fauxgl/main.go
deleted file mode 100644
index 012d924..0000000
--- a/sweet/benchmarks/fogleman-fauxgl/main.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
- "flag"
- "fmt"
- "image"
- "os"
- "runtime"
-
- "golang.org/x/benchmarks/sweet/benchmarks/internal/driver"
- animatebench "golang.org/x/benchmarks/third_party/fogleman-fauxgl"
-)
-
-var im image.Image
-
-var imagesPerRotation int
-
-func init() {
- flag.IntVar(&imagesPerRotation, "images-per-rotation", 72, "number of images per rotation to generate")
-}
-
-func main() {
- driver.SetFlags(flag.CommandLine)
- flag.Parse()
-
- if flag.NArg() != 1 {
- fmt.Fprintln(os.Stderr, "expected input STL file")
- os.Exit(1)
- }
- inc := 360 / imagesPerRotation
-
- // Load mesh into animation structure.
- anim, err := animatebench.Load(flag.Arg(0))
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- err = driver.RunBenchmark("FoglemanFauxGLRenderRotateBoat", func(b *driver.B) error {
- runtime.GC()
- b.ResetTimer()
- for i := 0; i < 360; i += inc {
- im = anim.RenderNext()
- }
- return nil
- }, driver.InProcessMeasurementOptions...)
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
diff --git a/sweet/benchmarks/fogleman-pt/README.md b/sweet/benchmarks/fogleman-pt/README.md
deleted file mode 100644
index e9e8662..0000000
--- a/sweet/benchmarks/fogleman-pt/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# fogleman-fauxgl Benchmark
-
-This directory contains a benchmark of Michael Fogleman's `pt` library which
-is a pure-Go path tracing rendering library. It performs a given number of
-rendering iterations on the input mesh (which is expected to be a Go Gopher).
diff --git a/sweet/benchmarks/fogleman-pt/main.go b/sweet/benchmarks/fogleman-pt/main.go
deleted file mode 100644
index ec11d76..0000000
--- a/sweet/benchmarks/fogleman-pt/main.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
- "flag"
- "fmt"
- "image"
- "os"
- "runtime"
-
- "golang.org/x/benchmarks/sweet/benchmarks/internal/driver"
- ptbench "golang.org/x/benchmarks/third_party/fogleman-pt"
-)
-
-var (
- iter int
- im image.Image
-)
-
-func init() {
- flag.Usage = func() {
- fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [flags] <gopher.obj>\n", os.Args[0])
- flag.PrintDefaults()
- }
- driver.SetFlags(flag.CommandLine)
- flag.IntVar(&iter, "iter", 2, "number of iterations to run renderer for")
-}
-
-func main() {
- flag.Parse()
-
- if flag.NArg() != 1 {
- fmt.Fprintln(os.Stderr, "expected one argument: gopher.obj")
- os.Exit(1)
- }
-
- // load and transform gopher mesh
- gopher, err := ptbench.Load(flag.Arg(0))
- if err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- os.Exit(1)
- }
-
- name := fmt.Sprintf("FoglemanPathTraceRenderGopherIter%d", iter)
- err = driver.RunBenchmark(name, func(b *driver.B) error {
- runtime.GC()
- b.ResetTimer()
- im = gopher.Render(iter)
- return nil
- }, driver.InProcessMeasurementOptions...)
- if err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- os.Exit(1)
- }
-}
diff --git a/sweet/cmd/sweet/benchmark.go b/sweet/cmd/sweet/benchmark.go
index b8402fd..fa54a31 100644
--- a/sweet/cmd/sweet/benchmark.go
+++ b/sweet/cmd/sweet/benchmark.go
@@ -40,24 +40,6 @@
generator: generators.BleveIndex(),
},
{
- name: "bleve-query",
- description: "Queries a pre-built search index with keywords",
- harness: harnesses.BleveQuery(),
- generator: generators.BleveQuery{},
- },
- {
- name: "fogleman-fauxgl",
- description: "Renders a rotating boat via an OpenGL-like software rendering pipeline",
- harness: harnesses.FoglemanFauxGL(),
- generator: generators.FoglemanFauxGL(),
- },
- {
- name: "fogleman-pt",
- description: "Renders a Go gopher via path tracing",
- harness: harnesses.FoglemanPT(),
- generator: generators.FoglemanPT(),
- },
- {
name: "go-build",
description: "Go build command",
harness: harnesses.GoBuild{},
@@ -104,8 +86,6 @@
allBenchmarksMap["biogo-igor"],
allBenchmarksMap["biogo-krishna"],
allBenchmarksMap["bleve-index"],
- allBenchmarksMap["bleve-query"],
- allBenchmarksMap["fogleman-pt"],
allBenchmarksMap["go-build"],
allBenchmarksMap["gopher-lua"],
// TODO(go.dev/issue/51445): Enable once gVisor builds with Go 1.19.
@@ -113,19 +93,9 @@
allBenchmarksMap["markdown"],
allBenchmarksMap["tile38"],
}
- if runtime.GOARCH != "arm64" {
- // TODO(go.dev/issue/54760): fogleman-fauxgl hangs on arm64.
- m["default"] = append(m["default"], allBenchmarksMap["fogleman-fauxgl"])
- }
for i := range allBenchmarks {
switch allBenchmarks[i].name {
- case "fogleman-fauxgl":
- if runtime.GOARCH == "arm64" {
- // TODO(go.dev/issue/54760): fogleman-fauxgl
- // hangs on arm64.
- continue
- }
case "gvisor":
// TODO(go.dev/issue/51445): Include in "all"
// once gVisor builds with Go 1.19.
diff --git a/sweet/cmd/sweet/integration_test.go b/sweet/cmd/sweet/integration_test.go
index 7c4b4d5..4bb60ed 100644
--- a/sweet/cmd/sweet/integration_test.go
+++ b/sweet/cmd/sweet/integration_test.go
@@ -167,10 +167,10 @@
sema := semaphore.NewWeighted(2)
var wg sync.WaitGroup
for i, shard := range []string{
- "tile38", "go-build", "biogo-igor", "biogo-krishna", "bleve-query",
+ "tile38", "go-build", "biogo-igor", "biogo-krishna",
// TODO(go.dev/issue/51445): Enable once gVisor builds with Go 1.19.
// "gvisor",
- "fogleman-pt", "bleve-index,fogleman-fauxgl,gopher-lua,markdown",
+ "bleve-index,gopher-lua,markdown",
} {
sema.Acquire(context.Background(), 1)
wg.Add(1)
diff --git a/sweet/generators/bleve-query.go b/sweet/generators/bleve-query.go
deleted file mode 100644
index b667fe1..0000000
--- a/sweet/generators/bleve-query.go
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !aix && !plan9
-// +build !aix,!plan9
-
-package generators
-
-import (
- "compress/bzip2"
- "io"
- "os"
- "path/filepath"
-
- "github.com/blevesearch/bleve"
- _ "github.com/blevesearch/bleve/analysis/analyzer/keyword"
- wikiparse "github.com/dustin/go-wikiparse"
-
- "golang.org/x/benchmarks/sweet/common"
- blevebench "golang.org/x/benchmarks/third_party/bleve-bench"
-)
-
-// documents is the number of documents to index.
-const documents = 25000
-
-// wikiDumpPath is a path to the static asset from
-// which we'll build our index.
-var wikiDumpPath = filepath.Join("..", "bleve-index", wikiDumpName)
-
-// BleveQuery is a dynamic assets Generator for the bleve-query benchmark.
-type BleveQuery struct{}
-
-// Generate creates a persistent index for the Bleve search engine for
-// the bleve-query benchmark. It generates this index from a subset of
-// the static assets for the bleve-index benchmark, a dump of wikipedia
-// from 2008.
-func (_ BleveQuery) Generate(cfg *common.GenConfig) (err error) {
- // Copy README.md over.
- if err := copyFiles(cfg.OutputDir, cfg.AssetsDir, []string{"README.md"}); err != nil {
- return err
- }
-
- f, err := os.Open(filepath.Join(cfg.AssetsDir, wikiDumpPath))
- if err != nil {
- return err
- }
- defer f.Close()
-
- z := bzip2.NewReader(f)
-
- parser, err := wikiparse.NewParser(z)
- if err != nil {
- return err
- }
-
- // Create a new Bleve index with on-disk
- // storage in the output directory.
- mapping := blevebench.ArticleMapping()
- outputDir := filepath.Join(cfg.OutputDir, "index")
- index, err := bleve.New(outputDir, mapping)
- if err != nil {
- return err
- }
- defer func() {
- // Make sure we close the index so the data
- // persists to disk.
- cerr := index.Close()
- if err == nil {
- err = cerr
- }
- }()
-
- todo := ^uint64(0)
- if documents >= 0 {
- todo = uint64(documents)
- }
-
- // Create batches of wikipedia articles
- // and index them.
- const batchSize = 256
- b := index.NewBatch()
- for i := uint64(0); i < todo; i++ {
- p, err := parser.Next()
- if err == io.EOF {
- break
- } else if err != nil {
- return err
- }
- if len(p.Revisions) == 0 {
- continue
- }
- b.Index(p.Title, blevebench.Article{
- Title: p.Title,
- Text: p.Revisions[0].Text,
- })
- if b.Size() >= batchSize {
- if err := index.Batch(b); err != nil {
- return err
- }
- b = index.NewBatch()
- }
- }
- if b.Size() != 0 {
- if err := index.Batch(b); err != nil {
- return err
- }
- }
- return nil
-}
diff --git a/sweet/generators/bleve-query_unsupported.go b/sweet/generators/bleve-query_unsupported.go
deleted file mode 100644
index 65d2fa8..0000000
--- a/sweet/generators/bleve-query_unsupported.go
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build aix || plan9
-// +build aix plan9
-
-package generators
-
-import (
- "fmt"
- "runtime"
-
- "golang.org/x/benchmarks/sweet/common"
-)
-
-// BleveQuery is a dynamic assets Generator for the bleve-query benchmark.
-type BleveQuery struct{}
-
-// Generate cannot run on these platforms.
-func (_ BleveQuery) Generate(_ *common.GenConfig) (err error) {
- return fmt.Errorf("platform %s/%s unsupported", runtime.GOOS, runtime.GOARCH)
-}
diff --git a/sweet/generators/copy.go b/sweet/generators/copy.go
index 9163015..0ef8d2a 100644
--- a/sweet/generators/copy.go
+++ b/sweet/generators/copy.go
@@ -68,23 +68,6 @@
}}
}
-func FoglemanFauxGL() common.Generator {
- return ©Static{assets: []string{
- "3dbenchy.stl",
- "README.md",
- "LICENSE",
- }}
-}
-
-func FoglemanPT() common.Generator {
- return ©Static{assets: []string{
- "gopher.mtl",
- "gopher.obj",
- "README.md",
- "LICENSE",
- }}
-}
-
func GopherLua() common.Generator {
return ©Static{
assets: []string{
diff --git a/sweet/harnesses/local.go b/sweet/harnesses/local.go
index 169d3ad..5982f6f 100644
--- a/sweet/harnesses/local.go
+++ b/sweet/harnesses/local.go
@@ -91,51 +91,6 @@
}
}
-func BleveQuery() common.Harness {
- return &localBenchHarness{
- binName: "bleve-query-bench",
- genArgs: func(cfg *common.Config, rcfg *common.RunConfig) []string {
- args := []string{filepath.Join(rcfg.AssetsDir, "index")}
- if rcfg.Short {
- args = append([]string{"-iterations", "1"}, args...)
- }
- return args
- },
- beforeRun: func(cfg *common.Config, rcfg *common.RunConfig) error {
- // Make sure all the index passed to the benchmark is writeable.
- indexPath := filepath.Join(rcfg.AssetsDir, "index")
- return makeWriteable(indexPath)
- },
- }
-}
-
-func FoglemanFauxGL() common.Harness {
- return &localBenchHarness{
- binName: "fogleman-fauxgl-bench",
- genArgs: func(cfg *common.Config, rcfg *common.RunConfig) []string {
- args := []string{filepath.Join(rcfg.AssetsDir, "3dbenchy.stl")}
- if rcfg.Short {
- args = append([]string{"-images-per-rotation", "1"}, args...)
- }
- return args
- },
- noStdout: true,
- }
-}
-
-func FoglemanPT() common.Harness {
- return &localBenchHarness{
- binName: "fogleman-pt-bench",
- genArgs: func(cfg *common.Config, rcfg *common.RunConfig) []string {
- return []string{
- "-iter", "1",
- filepath.Join(rcfg.AssetsDir, "gopher.obj"),
- }
- },
- noStdout: true,
- }
-}
-
func GopherLua() common.Harness {
return &localBenchHarness{
binName: "gopher-lua-bench",