mirror of https://github.com/golang/go.git
test/bench: delete
Russ added test/bench/go1 in CL 5484071 to have a stable suite of programs to use as benchmarks. For the compiler and runtime we had back then, those were reasonable benchmarks, but the compiler and runtime are now far more sophisticated and these benchmarks no longer have good coverage. We also now have better benchmark suites maintained outside the repo (e.g., golang.org/x/benchmarks). Keeping test/bench/go1 at this point is actively misleading. Indirectly related to #37486, as this also removes the last package dist test runs outside of src/. Change-Id: I2867ef303fe48a02acce58ace4ee682add8acdbf Reviewed-on: https://go-review.googlesource.com/c/go/+/494193 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
3943fc14d3
commit
b679e31cdb
|
|
@ -851,11 +851,6 @@ func (t *tester) registerTests() {
|
|||
}
|
||||
}
|
||||
|
||||
if goos != "android" && !t.iOS() {
|
||||
// There are no tests in this directory, only benchmarks.
|
||||
// Check that the test binary builds.
|
||||
t.registerTest("bench_go1", "", &goTest{dir: "../test/bench/go1"})
|
||||
}
|
||||
if goos != "android" && !t.iOS() {
|
||||
// Only start multiple test dir shards on builders,
|
||||
// where they get distributed to multiple machines.
|
||||
|
|
|
|||
|
|
@ -505,7 +505,6 @@ func findGorootModules(t *testing.T) []gorootModule {
|
|||
"std",
|
||||
"cmd",
|
||||
"misc",
|
||||
"test/bench/go1",
|
||||
}
|
||||
var seen = make(map[string]bool) // Key is module path.
|
||||
for _, m := range goroot.modules {
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
# Copyright 2010 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.
|
||||
|
||||
ALL=\
|
||||
parser\
|
||||
peano\
|
||||
tree\
|
||||
tree2\
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
%: %.go
|
||||
go build $*.go stats.go
|
||||
|
||||
%.bench: %
|
||||
time ./$*
|
||||
|
||||
bench: $(addsuffix .bench, $(ALL))
|
||||
|
||||
clean:
|
||||
rm -f $(ALL)
|
||||
|
||||
|
|
@ -1,280 +0,0 @@
|
|||
// Copyright 2010 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.
|
||||
|
||||
// Garbage collection benchmark: parse Go packages repeatedly.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"path"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var serve = flag.String("serve", "", "serve http on this address at end")
|
||||
|
||||
func isGoFile(dir os.FileInfo) bool {
|
||||
return !dir.IsDir() &&
|
||||
!strings.HasPrefix(dir.Name(), ".") && // ignore .files
|
||||
path.Ext(dir.Name()) == ".go"
|
||||
}
|
||||
|
||||
func isPkgFile(dir os.FileInfo) bool {
|
||||
return isGoFile(dir) &&
|
||||
!strings.HasSuffix(dir.Name(), "_test.go") // ignore test files
|
||||
}
|
||||
|
||||
func pkgName(filename string) string {
|
||||
file, err := parser.ParseFile(token.NewFileSet(), filename, nil, parser.PackageClauseOnly)
|
||||
if err != nil || file == nil {
|
||||
return ""
|
||||
}
|
||||
return file.Name.Name
|
||||
}
|
||||
|
||||
func parseDir(dirpath string) map[string]*ast.Package {
|
||||
// the package name is the directory name within its parent
|
||||
// (use dirname instead of path because dirname is clean; i.e. has no trailing '/')
|
||||
_, pkgname := path.Split(dirpath)
|
||||
|
||||
// filter function to select the desired .go files
|
||||
filter := func(d os.FileInfo) bool {
|
||||
if isPkgFile(d) {
|
||||
// Some directories contain main packages: Only accept
|
||||
// files that belong to the expected package so that
|
||||
// parser.ParsePackage doesn't return "multiple packages
|
||||
// found" errors.
|
||||
// Additionally, accept the special package name
|
||||
// fakePkgName if we are looking at cmd documentation.
|
||||
name := pkgName(dirpath + "/" + d.Name())
|
||||
return name == pkgname
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// get package AST
|
||||
pkgs, err := parser.ParseDir(token.NewFileSet(), dirpath, filter, parser.ParseComments)
|
||||
if err != nil {
|
||||
println("parse", dirpath, err.Error())
|
||||
panic("fail")
|
||||
}
|
||||
return pkgs
|
||||
}
|
||||
|
||||
func main() {
|
||||
st := new(runtime.MemStats)
|
||||
packages = append(packages, packages...)
|
||||
packages = append(packages, packages...)
|
||||
n := flag.Int("n", 4, "iterations")
|
||||
p := flag.Int("p", len(packages), "# of packages to keep in memory")
|
||||
flag.BoolVar(&st.DebugGC, "d", st.DebugGC, "print GC debugging info (pause times)")
|
||||
flag.Parse()
|
||||
|
||||
var lastParsed []map[string]*ast.Package
|
||||
var t0 time.Time
|
||||
var numGC uint32
|
||||
var pauseTotalNs uint64
|
||||
pkgroot := runtime.GOROOT() + "/src/"
|
||||
for pass := 0; pass < 2; pass++ {
|
||||
// Once the heap is grown to full size, reset counters.
|
||||
// This hides the start-up pauses, which are much smaller
|
||||
// than the normal pauses and would otherwise make
|
||||
// the average look much better than it actually is.
|
||||
runtime.ReadMemStats(st)
|
||||
numGC = st.NumGC
|
||||
pauseTotalNs = st.PauseTotalNs
|
||||
t0 = time.Now()
|
||||
|
||||
for i := 0; i < *n; i++ {
|
||||
parsed := make([]map[string]*ast.Package, *p)
|
||||
for j := range parsed {
|
||||
parsed[j] = parseDir(pkgroot + packages[j%len(packages)])
|
||||
}
|
||||
if i+1 == *n && *serve != "" {
|
||||
lastParsed = parsed
|
||||
}
|
||||
}
|
||||
runtime.GC()
|
||||
runtime.GC()
|
||||
}
|
||||
t1 := time.Now()
|
||||
|
||||
runtime.ReadMemStats(st)
|
||||
st.NumGC -= numGC
|
||||
st.PauseTotalNs -= pauseTotalNs
|
||||
fmt.Printf("Alloc=%d/%d Heap=%d Mallocs=%d PauseTime=%.3f/%d = %.3f\n",
|
||||
st.Alloc, st.TotalAlloc,
|
||||
st.Sys,
|
||||
st.Mallocs, float64(st.PauseTotalNs)/1e9,
|
||||
st.NumGC, float64(st.PauseTotalNs)/1e9/float64(st.NumGC))
|
||||
|
||||
/*
|
||||
fmt.Printf("%10s %10s %10s\n", "size", "#alloc", "#free")
|
||||
for _, s := range st.BySize {
|
||||
fmt.Printf("%10d %10d %10d\n", s.Size, s.Mallocs, s.Frees)
|
||||
}
|
||||
*/
|
||||
// Standard gotest benchmark output, collected by build dashboard.
|
||||
gcstats("BenchmarkParser", *n, t1.Sub(t0))
|
||||
|
||||
if *serve != "" {
|
||||
log.Fatal(http.ListenAndServe(*serve, nil))
|
||||
println(lastParsed)
|
||||
}
|
||||
}
|
||||
|
||||
// find . -type d -not -path "./exp" -not -path "./exp/*" -printf "\t\"%p\",\n" | sort | sed "s/\.\///" | grep -v testdata
|
||||
var packages = []string{
|
||||
"archive",
|
||||
"archive/tar",
|
||||
"archive/zip",
|
||||
"bufio",
|
||||
"builtin",
|
||||
"bytes",
|
||||
"compress",
|
||||
"compress/bzip2",
|
||||
"compress/flate",
|
||||
"compress/gzip",
|
||||
"compress/lzw",
|
||||
"compress/zlib",
|
||||
"container",
|
||||
"container/heap",
|
||||
"container/list",
|
||||
"container/ring",
|
||||
"crypto",
|
||||
"crypto/aes",
|
||||
"crypto/cipher",
|
||||
"crypto/des",
|
||||
"crypto/dsa",
|
||||
"crypto/ecdsa",
|
||||
"crypto/elliptic",
|
||||
"crypto/hmac",
|
||||
"crypto/md5",
|
||||
"crypto/rand",
|
||||
"crypto/rc4",
|
||||
"crypto/rsa",
|
||||
"crypto/sha1",
|
||||
"crypto/sha256",
|
||||
"crypto/sha512",
|
||||
"crypto/subtle",
|
||||
"crypto/tls",
|
||||
"crypto/x509",
|
||||
"crypto/x509/pkix",
|
||||
"database",
|
||||
"database/sql",
|
||||
"database/sql/driver",
|
||||
"debug",
|
||||
"debug/dwarf",
|
||||
"debug/elf",
|
||||
"debug/gosym",
|
||||
"debug/macho",
|
||||
"debug/pe",
|
||||
"encoding",
|
||||
"encoding/ascii85",
|
||||
"encoding/asn1",
|
||||
"encoding/base32",
|
||||
"encoding/base64",
|
||||
"encoding/binary",
|
||||
"encoding/csv",
|
||||
"encoding/gob",
|
||||
"encoding/hex",
|
||||
"encoding/json",
|
||||
"encoding/pem",
|
||||
"encoding/xml",
|
||||
"errors",
|
||||
"expvar",
|
||||
"flag",
|
||||
"fmt",
|
||||
"go",
|
||||
"go/ast",
|
||||
"go/build",
|
||||
"go/doc",
|
||||
"go/format",
|
||||
"go/parser",
|
||||
"go/printer",
|
||||
"go/scanner",
|
||||
"go/token",
|
||||
"hash",
|
||||
"hash/adler32",
|
||||
"hash/crc32",
|
||||
"hash/crc64",
|
||||
"hash/fnv",
|
||||
"html",
|
||||
"html/template",
|
||||
"image",
|
||||
"image/color",
|
||||
"image/draw",
|
||||
"image/gif",
|
||||
"image/jpeg",
|
||||
"image/png",
|
||||
"index",
|
||||
"index/suffixarray",
|
||||
"io",
|
||||
"io/ioutil",
|
||||
"log",
|
||||
"log/syslog",
|
||||
"math",
|
||||
"math/big",
|
||||
"math/cmplx",
|
||||
"math/rand",
|
||||
"mime",
|
||||
"mime/multipart",
|
||||
"net",
|
||||
"net/http",
|
||||
"net/http/cgi",
|
||||
"net/http/cookiejar",
|
||||
"net/http/fcgi",
|
||||
"net/http/httptest",
|
||||
"net/http/httputil",
|
||||
"net/http/pprof",
|
||||
"net/mail",
|
||||
"net/rpc",
|
||||
"net/rpc/jsonrpc",
|
||||
"net/smtp",
|
||||
"net/textproto",
|
||||
"net/url",
|
||||
"os",
|
||||
"os/exec",
|
||||
"os/signal",
|
||||
"os/user",
|
||||
"path",
|
||||
"path/filepath",
|
||||
"reflect",
|
||||
"regexp",
|
||||
"regexp/syntax",
|
||||
"runtime",
|
||||
"runtime/cgo",
|
||||
"runtime/debug",
|
||||
"runtime/pprof",
|
||||
"runtime/race",
|
||||
"sort",
|
||||
"strconv",
|
||||
"strings",
|
||||
"sync",
|
||||
"sync/atomic",
|
||||
"syscall",
|
||||
"testing",
|
||||
"testing/iotest",
|
||||
"testing/quick",
|
||||
"text",
|
||||
"text/scanner",
|
||||
"text/tabwriter",
|
||||
"text/template",
|
||||
"text/template/parse",
|
||||
"time",
|
||||
"unicode",
|
||||
"unicode/utf16",
|
||||
"unicode/utf8",
|
||||
"unsafe",
|
||||
}
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
// run
|
||||
|
||||
// Copyright 2009 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 (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Number struct {
|
||||
next *Number
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Peano primitives
|
||||
|
||||
func zero() *Number { return nil }
|
||||
|
||||
func is_zero(x *Number) bool { return x == nil }
|
||||
|
||||
func add1(x *Number) *Number {
|
||||
e := new(Number)
|
||||
e.next = x
|
||||
return e
|
||||
}
|
||||
|
||||
func sub1(x *Number) *Number { return x.next }
|
||||
|
||||
func add(x, y *Number) *Number {
|
||||
if is_zero(y) {
|
||||
return x
|
||||
}
|
||||
|
||||
return add(add1(x), sub1(y))
|
||||
}
|
||||
|
||||
func mul(x, y *Number) *Number {
|
||||
if is_zero(x) || is_zero(y) {
|
||||
return zero()
|
||||
}
|
||||
|
||||
return add(mul(x, sub1(y)), x)
|
||||
}
|
||||
|
||||
func fact(n *Number) *Number {
|
||||
if is_zero(n) {
|
||||
return add1(zero())
|
||||
}
|
||||
|
||||
return mul(fact(sub1(n)), n)
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Helpers to generate/count Peano integers
|
||||
|
||||
func gen(n int) *Number {
|
||||
if n > 0 {
|
||||
return add1(gen(n - 1))
|
||||
}
|
||||
|
||||
return zero()
|
||||
}
|
||||
|
||||
func count(x *Number) int {
|
||||
if is_zero(x) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return count(sub1(x)) + 1
|
||||
}
|
||||
|
||||
func check(x *Number, expected int) {
|
||||
var c = count(x)
|
||||
if c != expected {
|
||||
panic(fmt.Sprintf("error: found %d; expected %d", c, expected))
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Test basic functionality
|
||||
|
||||
func verify() {
|
||||
check(zero(), 0)
|
||||
check(add1(zero()), 1)
|
||||
check(gen(10), 10)
|
||||
|
||||
check(add(gen(3), zero()), 3)
|
||||
check(add(zero(), gen(4)), 4)
|
||||
check(add(gen(3), gen(4)), 7)
|
||||
|
||||
check(mul(zero(), zero()), 0)
|
||||
check(mul(gen(3), zero()), 0)
|
||||
check(mul(zero(), gen(4)), 0)
|
||||
check(mul(gen(3), add1(zero())), 3)
|
||||
check(mul(add1(zero()), gen(4)), 4)
|
||||
check(mul(gen(3), gen(4)), 12)
|
||||
|
||||
check(fact(zero()), 1)
|
||||
check(fact(add1(zero())), 1)
|
||||
check(fact(gen(5)), 120)
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Factorial
|
||||
|
||||
func main() {
|
||||
t0 := time.Now()
|
||||
verify()
|
||||
for i := 0; i <= 9; i++ {
|
||||
print(i, "! = ", count(fact(gen(i))), "\n")
|
||||
}
|
||||
runtime.GC()
|
||||
t1 := time.Now()
|
||||
|
||||
gcstats("BenchmarkPeano", 1, t1.Sub(t0))
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
// Copyright 2010 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 (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
func gcstats(name string, n int, t time.Duration) {
|
||||
st := new(runtime.MemStats)
|
||||
runtime.ReadMemStats(st)
|
||||
nprocs := runtime.GOMAXPROCS(-1)
|
||||
cpus := ""
|
||||
if nprocs != 1 {
|
||||
cpus = fmt.Sprintf("-%d", nprocs)
|
||||
}
|
||||
fmt.Printf("garbage.%sMem%s Alloc=%d/%d Heap=%d NextGC=%d Mallocs=%d\n", name, cpus, st.Alloc, st.TotalAlloc, st.Sys, st.NextGC, st.Mallocs)
|
||||
fmt.Printf("garbage.%s%s %d %d ns/op\n", name, cpus, n, t.Nanoseconds()/int64(n))
|
||||
fmt.Printf("garbage.%sLastPause%s 1 %d ns/op\n", name, cpus, st.PauseNs[(st.NumGC-1)%uint32(len(st.PauseNs))])
|
||||
fmt.Printf("garbage.%sPause%s %d %d ns/op\n", name, cpus, st.NumGC, int64(st.PauseTotalNs)/int64(st.NumGC))
|
||||
nn := int(st.NumGC)
|
||||
if nn >= len(st.PauseNs) {
|
||||
nn = len(st.PauseNs)
|
||||
}
|
||||
t1, t2, t3, t4, t5 := tukey5(st.PauseNs[0:nn])
|
||||
fmt.Printf("garbage.%sPause5%s: %d %d %d %d %d\n", name, cpus, t1, t2, t3, t4, t5)
|
||||
|
||||
// fmt.Printf("garbage.%sScan: %v\n", name, st.ScanDist)
|
||||
}
|
||||
|
||||
type T []uint64
|
||||
|
||||
func (t T) Len() int { return len(t) }
|
||||
func (t T) Swap(i, j int) { t[i], t[j] = t[j], t[i] }
|
||||
func (t T) Less(i, j int) bool { return t[i] < t[j] }
|
||||
|
||||
func tukey5(raw []uint64) (lo, q1, q2, q3, hi uint64) {
|
||||
x := make(T, len(raw))
|
||||
copy(x, raw)
|
||||
sort.Sort(T(x))
|
||||
lo = x[0]
|
||||
q1 = x[len(x)/4]
|
||||
q2 = x[len(x)/2]
|
||||
q3 = x[len(x)*3/4]
|
||||
hi = x[len(x)-1]
|
||||
return
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
/*
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of "The Computer Language Benchmarks Game" nor the
|
||||
name of "The Computer Language Shootout Benchmarks" nor the names of
|
||||
its contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* The Computer Language Benchmarks Game
|
||||
* https://benchmarksgame-team.pages.debian.net/benchmarksgame/
|
||||
*
|
||||
* contributed by The Go Authors.
|
||||
* based on C program by Kevin Carson
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
var n = flag.Int("n", 16, "depth")
|
||||
|
||||
type Node struct {
|
||||
item int
|
||||
left, right *Node
|
||||
}
|
||||
|
||||
func bottomUpTree(item, depth int) *Node {
|
||||
if depth <= 0 {
|
||||
return &Node{item: item}
|
||||
}
|
||||
return &Node{item, bottomUpTree(2*item-1, depth-1), bottomUpTree(2*item, depth-1)}
|
||||
}
|
||||
|
||||
func (n *Node) itemCheck() int {
|
||||
if n.left == nil {
|
||||
return n.item
|
||||
}
|
||||
return n.item + n.left.itemCheck() - n.right.itemCheck()
|
||||
}
|
||||
|
||||
const minDepth = 4
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
t0 := time.Now()
|
||||
|
||||
maxDepth := *n
|
||||
if minDepth+2 > *n {
|
||||
maxDepth = minDepth + 2
|
||||
}
|
||||
stretchDepth := maxDepth + 1
|
||||
|
||||
check := bottomUpTree(0, stretchDepth).itemCheck()
|
||||
fmt.Printf("stretch tree of depth %d\t check: %d\n", stretchDepth, check)
|
||||
|
||||
longLivedTree := bottomUpTree(0, maxDepth)
|
||||
|
||||
for depth := minDepth; depth <= maxDepth; depth += 2 {
|
||||
iterations := 1 << uint(maxDepth-depth+minDepth)
|
||||
check = 0
|
||||
|
||||
for i := 1; i <= iterations; i++ {
|
||||
check += bottomUpTree(i, depth).itemCheck()
|
||||
check += bottomUpTree(-i, depth).itemCheck()
|
||||
}
|
||||
fmt.Printf("%d\t trees of depth %d\t check: %d\n", iterations*2, depth, check)
|
||||
}
|
||||
fmt.Printf("long lived tree of depth %d\t check: %d\n", maxDepth, longLivedTree.itemCheck())
|
||||
|
||||
t1 := time.Now()
|
||||
|
||||
// Standard gotest benchmark output, collected by build dashboard.
|
||||
gcstats("BenchmarkTree", *n, t1.Sub(t0))
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
// Copyright 2012 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"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
"time"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const BranchingFactor = 4
|
||||
|
||||
type Object struct {
|
||||
child [BranchingFactor]*Object
|
||||
}
|
||||
|
||||
var (
|
||||
cpus = flag.Int("cpus", 1, "number of cpus to use")
|
||||
heapsize = flag.Int64("heapsize", 100*1024*1024, "size of the heap in bytes")
|
||||
cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
|
||||
|
||||
lastPauseNs uint64 = 0
|
||||
lastFree uint64 = 0
|
||||
heap *Object
|
||||
calls [20]int
|
||||
numobjects int64
|
||||
memstats runtime.MemStats
|
||||
)
|
||||
|
||||
func buildHeap() {
|
||||
objsize := int64(unsafe.Sizeof(Object{}))
|
||||
heap, _ = buildTree(float64(objsize), float64(*heapsize), 0)
|
||||
fmt.Printf("*** built heap: %.0f MB; (%d objects * %d bytes)\n",
|
||||
float64(*heapsize)/1048576, numobjects, objsize)
|
||||
}
|
||||
|
||||
func buildTree(objsize, size float64, depth int) (*Object, float64) {
|
||||
calls[depth]++
|
||||
x := &Object{}
|
||||
numobjects++
|
||||
subtreeSize := (size - objsize) / BranchingFactor
|
||||
alloc := objsize
|
||||
for i := 0; i < BranchingFactor && alloc < size; i++ {
|
||||
c, n := buildTree(objsize, subtreeSize, depth+1)
|
||||
x.child[i] = c
|
||||
alloc += n
|
||||
}
|
||||
return x, alloc
|
||||
}
|
||||
|
||||
func gc() {
|
||||
runtime.GC()
|
||||
runtime.ReadMemStats(&memstats)
|
||||
pause := memstats.PauseTotalNs
|
||||
inuse := memstats.Alloc
|
||||
free := memstats.TotalAlloc - inuse
|
||||
fmt.Printf("gc pause: %8.3f ms; collect: %8.0f MB; heapsize: %8.0f MB\n",
|
||||
float64(pause-lastPauseNs)/1e6,
|
||||
float64(free-lastFree)/1048576,
|
||||
float64(inuse)/1048576)
|
||||
lastPauseNs = pause
|
||||
lastFree = free
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
buildHeap()
|
||||
runtime.GOMAXPROCS(*cpus)
|
||||
runtime.ReadMemStats(&memstats)
|
||||
lastPauseNs = memstats.PauseTotalNs
|
||||
lastFree = memstats.TotalAlloc - memstats.Alloc
|
||||
if *cpuprofile != "" {
|
||||
f, err := os.Create(*cpuprofile)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
pprof.StartCPUProfile(f)
|
||||
defer pprof.StopCPUProfile()
|
||||
}
|
||||
const N = 10
|
||||
var t0 time.Time
|
||||
for i := 0; i < N; i++ {
|
||||
t0 = time.Now()
|
||||
gc()
|
||||
}
|
||||
// Standard gotest benchmark output, collected by build dashboard.
|
||||
gcstats("BenchmarkTree2", N, time.Now().Sub(t0))
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
// Copyright 2011 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.
|
||||
|
||||
// This benchmark, taken from the shootout, tests garbage collector
|
||||
// performance by generating and discarding large binary trees.
|
||||
|
||||
package go1
|
||||
|
||||
import "testing"
|
||||
|
||||
type binaryNode struct {
|
||||
item int
|
||||
left, right *binaryNode
|
||||
}
|
||||
|
||||
func bottomUpTree(item, depth int) *binaryNode {
|
||||
if depth <= 0 {
|
||||
return &binaryNode{item: item}
|
||||
}
|
||||
return &binaryNode{item, bottomUpTree(2*item-1, depth-1), bottomUpTree(2*item, depth-1)}
|
||||
}
|
||||
|
||||
func (n *binaryNode) itemCheck() int {
|
||||
if n.left == nil {
|
||||
return n.item
|
||||
}
|
||||
return n.item + n.left.itemCheck() - n.right.itemCheck()
|
||||
}
|
||||
|
||||
const minDepth = 4
|
||||
|
||||
func binarytree(n int) {
|
||||
maxDepth := n
|
||||
if minDepth+2 > n {
|
||||
maxDepth = minDepth + 2
|
||||
}
|
||||
stretchDepth := maxDepth + 1
|
||||
|
||||
check := bottomUpTree(0, stretchDepth).itemCheck()
|
||||
//fmt.Printf("stretch tree of depth %d\t check: %d\n", stretchDepth, check)
|
||||
|
||||
longLivedTree := bottomUpTree(0, maxDepth)
|
||||
|
||||
for depth := minDepth; depth <= maxDepth; depth += 2 {
|
||||
iterations := 1 << uint(maxDepth-depth+minDepth)
|
||||
check = 0
|
||||
|
||||
for i := 1; i <= iterations; i++ {
|
||||
check += bottomUpTree(i, depth).itemCheck()
|
||||
check += bottomUpTree(-i, depth).itemCheck()
|
||||
}
|
||||
//fmt.Printf("%d\t trees of depth %d\t check: %d\n", iterations*2, depth, check)
|
||||
}
|
||||
longLivedTree.itemCheck()
|
||||
//fmt.Printf("long lived tree of depth %d\t check: %d\n", maxDepth, longLivedTree.itemCheck())
|
||||
}
|
||||
|
||||
func BenchmarkBinaryTree17(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
binarytree(17)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
// Copyright 2011 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.
|
||||
|
||||
// This benchmark, taken from the shootout, tests array indexing
|
||||
// and array bounds elimination performance.
|
||||
|
||||
package go1
|
||||
|
||||
import "testing"
|
||||
|
||||
func fannkuch(n int) int {
|
||||
if n < 1 {
|
||||
return 0
|
||||
}
|
||||
|
||||
n1 := n - 1
|
||||
perm := make([]int, n)
|
||||
perm1 := make([]int, n)
|
||||
count := make([]int, n)
|
||||
|
||||
for i := 0; i < n; i++ {
|
||||
perm1[i] = i // initial (trivial) permutation
|
||||
}
|
||||
|
||||
r := n
|
||||
didpr := 0
|
||||
flipsMax := 0
|
||||
for {
|
||||
if didpr < 30 {
|
||||
didpr++
|
||||
}
|
||||
for ; r != 1; r-- {
|
||||
count[r-1] = r
|
||||
}
|
||||
|
||||
if perm1[0] != 0 && perm1[n1] != n1 {
|
||||
flips := 0
|
||||
for i := 1; i < n; i++ { // perm = perm1
|
||||
perm[i] = perm1[i]
|
||||
}
|
||||
k := perm1[0] // cache perm[0] in k
|
||||
for { // k!=0 ==> k>0
|
||||
for i, j := 1, k-1; i < j; i, j = i+1, j-1 {
|
||||
perm[i], perm[j] = perm[j], perm[i]
|
||||
}
|
||||
flips++
|
||||
// Now exchange k (caching perm[0]) and perm[k]... with care!
|
||||
j := perm[k]
|
||||
perm[k] = k
|
||||
k = j
|
||||
if k == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if flipsMax < flips {
|
||||
flipsMax = flips
|
||||
}
|
||||
}
|
||||
|
||||
for ; r < n; r++ {
|
||||
// rotate down perm[0..r] by one
|
||||
perm0 := perm1[0]
|
||||
for i := 0; i < r; i++ {
|
||||
perm1[i] = perm1[i+1]
|
||||
}
|
||||
perm1[r] = perm0
|
||||
count[r]--
|
||||
if count[r] > 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if r == n {
|
||||
return flipsMax
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func BenchmarkFannkuch11(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
fannkuch(11)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
// Copyright 2011 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 go1
|
||||
|
||||
import "runtime"
|
||||
|
||||
// Not a benchmark; input for revcomp.
|
||||
|
||||
func makefasta() []byte {
|
||||
var n int = 25e6
|
||||
if runtime.GOARCH == "arm" || runtime.GOARCH == "mips" || runtime.GOARCH == "mips64" {
|
||||
// TODO(dfc) remove this limitation after precise gc.
|
||||
// A value of 25e6 consumes 465mb of heap on 32bit
|
||||
// platforms, which is too much for some systems.
|
||||
// A value of 25e5 produces a memory layout that
|
||||
// confuses the gc on 32bit platforms. So 25e4 it is.
|
||||
n = 25e4
|
||||
}
|
||||
return fasta(n)
|
||||
}
|
||||
|
||||
func fasta(n int) []byte {
|
||||
out := make(fastaBuffer, 0, 11*n)
|
||||
|
||||
iub := []fastaAcid{
|
||||
{prob: 0.27, sym: 'a'},
|
||||
{prob: 0.12, sym: 'c'},
|
||||
{prob: 0.12, sym: 'g'},
|
||||
{prob: 0.27, sym: 't'},
|
||||
{prob: 0.02, sym: 'B'},
|
||||
{prob: 0.02, sym: 'D'},
|
||||
{prob: 0.02, sym: 'H'},
|
||||
{prob: 0.02, sym: 'K'},
|
||||
{prob: 0.02, sym: 'M'},
|
||||
{prob: 0.02, sym: 'N'},
|
||||
{prob: 0.02, sym: 'R'},
|
||||
{prob: 0.02, sym: 'S'},
|
||||
{prob: 0.02, sym: 'V'},
|
||||
{prob: 0.02, sym: 'W'},
|
||||
{prob: 0.02, sym: 'Y'},
|
||||
}
|
||||
|
||||
homosapiens := []fastaAcid{
|
||||
{prob: 0.3029549426680, sym: 'a'},
|
||||
{prob: 0.1979883004921, sym: 'c'},
|
||||
{prob: 0.1975473066391, sym: 'g'},
|
||||
{prob: 0.3015094502008, sym: 't'},
|
||||
}
|
||||
|
||||
alu := []byte(
|
||||
"GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG" +
|
||||
"GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA" +
|
||||
"CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT" +
|
||||
"ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA" +
|
||||
"GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG" +
|
||||
"AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC" +
|
||||
"AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA")
|
||||
|
||||
out.WriteString(">ONE Homo sapiens alu\n")
|
||||
fastaRepeat(&out, alu, 2*n)
|
||||
out.WriteString(">TWO IUB ambiguity codes\n")
|
||||
fastaRandom(&out, iub, 3*n)
|
||||
out.WriteString(">THREE Homo sapiens frequency\n")
|
||||
fastaRandom(&out, homosapiens, 5*n)
|
||||
return out
|
||||
}
|
||||
|
||||
type fastaBuffer []byte
|
||||
|
||||
func (b *fastaBuffer) Flush() {
|
||||
panic("flush")
|
||||
}
|
||||
|
||||
func (b *fastaBuffer) WriteString(s string) {
|
||||
p := b.NextWrite(len(s))
|
||||
copy(p, s)
|
||||
}
|
||||
|
||||
func (b *fastaBuffer) NextWrite(n int) []byte {
|
||||
p := *b
|
||||
if len(p)+n > cap(p) {
|
||||
b.Flush()
|
||||
p = *b
|
||||
}
|
||||
out := p[len(p) : len(p)+n]
|
||||
*b = p[:len(p)+n]
|
||||
return out
|
||||
}
|
||||
|
||||
const fastaLine = 60
|
||||
|
||||
func fastaRepeat(out *fastaBuffer, alu []byte, n int) {
|
||||
buf := append(alu, alu...)
|
||||
off := 0
|
||||
for n > 0 {
|
||||
m := n
|
||||
if m > fastaLine {
|
||||
m = fastaLine
|
||||
}
|
||||
buf1 := out.NextWrite(m + 1)
|
||||
copy(buf1, buf[off:])
|
||||
buf1[m] = '\n'
|
||||
if off += m; off >= len(alu) {
|
||||
off -= len(alu)
|
||||
}
|
||||
n -= m
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
fastaLookupSize = 4096
|
||||
fastaLookupScale float64 = fastaLookupSize - 1
|
||||
)
|
||||
|
||||
var fastaRand uint32 = 42
|
||||
|
||||
type fastaAcid struct {
|
||||
sym byte
|
||||
prob float64
|
||||
cprob float64
|
||||
next *fastaAcid
|
||||
}
|
||||
|
||||
func fastaComputeLookup(acid []fastaAcid) *[fastaLookupSize]*fastaAcid {
|
||||
var lookup [fastaLookupSize]*fastaAcid
|
||||
var p float64
|
||||
for i := range acid {
|
||||
p += acid[i].prob
|
||||
acid[i].cprob = p * fastaLookupScale
|
||||
if i > 0 {
|
||||
acid[i-1].next = &acid[i]
|
||||
}
|
||||
}
|
||||
acid[len(acid)-1].cprob = 1.0 * fastaLookupScale
|
||||
|
||||
j := 0
|
||||
for i := range lookup {
|
||||
for acid[j].cprob < float64(i) {
|
||||
j++
|
||||
}
|
||||
lookup[i] = &acid[j]
|
||||
}
|
||||
|
||||
return &lookup
|
||||
}
|
||||
|
||||
func fastaRandom(out *fastaBuffer, acid []fastaAcid, n int) {
|
||||
const (
|
||||
IM = 139968
|
||||
IA = 3877
|
||||
IC = 29573
|
||||
)
|
||||
lookup := fastaComputeLookup(acid)
|
||||
for n > 0 {
|
||||
m := n
|
||||
if m > fastaLine {
|
||||
m = fastaLine
|
||||
}
|
||||
buf := out.NextWrite(m + 1)
|
||||
f := fastaLookupScale / IM
|
||||
myrand := fastaRand
|
||||
for i := 0; i < m; i++ {
|
||||
myrand = (myrand*IA + IC) % IM
|
||||
r := float64(int(myrand)) * f
|
||||
a := lookup[int(r)]
|
||||
for a.cprob < r {
|
||||
a = a.next
|
||||
}
|
||||
buf[i] = a.sym
|
||||
}
|
||||
fastaRand = myrand
|
||||
buf[m] = '\n'
|
||||
n -= m
|
||||
}
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
// Copyright 2013 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 go1
|
||||
|
||||
// benchmark based on fmt/fmt_test.go
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkFmtFprintfEmpty(b *testing.B) {
|
||||
var buf bytes.Buffer
|
||||
for i := 0; i < b.N; i++ {
|
||||
fmt.Fprintf(&buf, "")
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFmtFprintfString(b *testing.B) {
|
||||
var buf bytes.Buffer
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf.Reset()
|
||||
fmt.Fprintf(&buf, "%s", "hello")
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFmtFprintfInt(b *testing.B) {
|
||||
var buf bytes.Buffer
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf.Reset()
|
||||
fmt.Fprintf(&buf, "%d", 5)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFmtFprintfIntInt(b *testing.B) {
|
||||
var buf bytes.Buffer
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf.Reset()
|
||||
fmt.Fprintf(&buf, "%d %d", 5, 6)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFmtFprintfPrefixedInt(b *testing.B) {
|
||||
var buf bytes.Buffer
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf.Reset()
|
||||
fmt.Fprintf(&buf, "This is some meaningless prefix text that needs to be scanned %d", 6)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFmtFprintfFloat(b *testing.B) {
|
||||
var buf bytes.Buffer
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf.Reset()
|
||||
fmt.Fprintf(&buf, "%g", 5.23184)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFmtManyArgs(b *testing.B) {
|
||||
var buf bytes.Buffer
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf.Reset()
|
||||
fmt.Fprintf(&buf, "%2d/%2d/%2d %d:%d:%d %s %s\n", 3, 4, 5, 11, 12, 13, "hello", "world")
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
module test/bench/go1
|
||||
|
||||
go 1.12
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
// Copyright 2011 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.
|
||||
|
||||
// This benchmark tests gob encoding and decoding performance.
|
||||
|
||||
package go1
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/gob"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"log"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func makeGob(jsondata *JSONResponse) (data *JSONResponse, b []byte) {
|
||||
data = gobResponse(jsondata)
|
||||
|
||||
var buf bytes.Buffer
|
||||
if err := gob.NewEncoder(&buf).Encode(data); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
b = buf.Bytes()
|
||||
|
||||
var r JSONResponse
|
||||
if err := gob.NewDecoder(bytes.NewBuffer(b)).Decode(&r); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if !reflect.DeepEqual(data, &r) {
|
||||
log.Printf("%v\n%v", jsondata, r)
|
||||
b, _ := json.Marshal(&jsondata)
|
||||
br, _ := json.Marshal(&r)
|
||||
log.Printf("%s\n%s\n", b, br)
|
||||
panic("gob: encode+decode lost data")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// gob turns [] into null, so make a copy of the data structure like that
|
||||
func gobResponse(r *JSONResponse) *JSONResponse {
|
||||
return &JSONResponse{gobNode(r.Tree), r.Username}
|
||||
}
|
||||
|
||||
func gobNode(n *JSONNode) *JSONNode {
|
||||
n1 := new(JSONNode)
|
||||
*n1 = *n
|
||||
if len(n1.Kids) == 0 {
|
||||
n1.Kids = nil
|
||||
} else {
|
||||
for i, k := range n1.Kids {
|
||||
n1.Kids[i] = gobNode(k)
|
||||
}
|
||||
}
|
||||
return n1
|
||||
}
|
||||
|
||||
func gobdec(b []byte) {
|
||||
var r JSONResponse
|
||||
if err := gob.NewDecoder(bytes.NewBuffer(b)).Decode(&r); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_ = r
|
||||
}
|
||||
|
||||
func gobenc(data *JSONResponse) {
|
||||
if err := gob.NewEncoder(io.Discard).Encode(data); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkGobDecode(b *testing.B) {
|
||||
jsonbytes := makeJsonBytes()
|
||||
jsondata := makeJsonData(jsonbytes)
|
||||
_, bytes := makeGob(jsondata)
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(len(bytes)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
gobdec(bytes)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkGobEncode(b *testing.B) {
|
||||
jsonbytes := makeJsonBytes()
|
||||
jsondata := makeJsonData(jsonbytes)
|
||||
data, bytes := makeGob(jsondata)
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(len(bytes)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
gobenc(data)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
// Copyright 2011 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.
|
||||
|
||||
// This benchmark tests gzip and gunzip performance.
|
||||
|
||||
package go1
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
gz "compress/gzip"
|
||||
"io"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func makeGunzip(jsonbytes []byte) []byte {
|
||||
return bytes.Repeat(jsonbytes, 10)
|
||||
}
|
||||
|
||||
func makeGzip(jsongunz []byte) []byte {
|
||||
var buf bytes.Buffer
|
||||
c := gz.NewWriter(&buf)
|
||||
c.Write(jsongunz)
|
||||
c.Close()
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
func gzip(jsongunz []byte) {
|
||||
c := gz.NewWriter(io.Discard)
|
||||
if _, err := c.Write(jsongunz); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := c.Close(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func gunzip(jsongz []byte) {
|
||||
r, err := gz.NewReader(bytes.NewBuffer(jsongz))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if _, err := io.Copy(io.Discard, r); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
r.Close()
|
||||
}
|
||||
|
||||
func BenchmarkGzip(b *testing.B) {
|
||||
jsonbytes := makeJsonBytes()
|
||||
jsongunz := makeGunzip(jsonbytes)
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(len(jsongunz)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
gzip(jsongunz)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkGunzip(b *testing.B) {
|
||||
jsonbytes := makeJsonBytes()
|
||||
jsongunz := makeGunzip(jsonbytes)
|
||||
jsongz := makeGzip(jsongunz)
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(len(jsongunz)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
gunzip(jsongz)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
// Copyright 2013 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 go1
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// BenchmarkHTTPClientServer benchmarks both the HTTP client and the HTTP server,
|
||||
// on small requests.
|
||||
func BenchmarkHTTPClientServer(b *testing.B) {
|
||||
msg := []byte("Hello world.\n")
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
|
||||
rw.Write(msg)
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
tr := &http.Transport{}
|
||||
defer tr.CloseIdleConnections()
|
||||
cl := &http.Client{
|
||||
Transport: tr,
|
||||
}
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
res, err := cl.Get(ts.URL)
|
||||
if err != nil {
|
||||
b.Fatal("Get:", err)
|
||||
}
|
||||
all, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
b.Fatal("ReadAll:", err)
|
||||
}
|
||||
if !bytes.Equal(all, msg) {
|
||||
b.Fatalf("Got body %q; want %q", all, msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
// Copyright 2011 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.
|
||||
|
||||
// This benchmark tests JSON encoding and decoding performance.
|
||||
|
||||
package go1
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/bzip2"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func makeJsonBytes() []byte {
|
||||
var r io.Reader
|
||||
r = bytes.NewReader(bytes.Replace(jsonbz2_base64, []byte{'\n'}, nil, -1))
|
||||
r = base64.NewDecoder(base64.StdEncoding, r)
|
||||
r = bzip2.NewReader(r)
|
||||
b, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func makeJsonData(jsonbytes []byte) *JSONResponse {
|
||||
var v JSONResponse
|
||||
if err := json.Unmarshal(jsonbytes, &v); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return &v
|
||||
}
|
||||
|
||||
type JSONResponse struct {
|
||||
Tree *JSONNode `json:"tree"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
type JSONNode struct {
|
||||
Name string `json:"name"`
|
||||
Kids []*JSONNode `json:"kids"`
|
||||
CLWeight float64 `json:"cl_weight"`
|
||||
Touches int `json:"touches"`
|
||||
MinT int64 `json:"min_t"`
|
||||
MaxT int64 `json:"max_t"`
|
||||
MeanT int64 `json:"mean_t"`
|
||||
}
|
||||
|
||||
func jsondec(bytes []byte) {
|
||||
var r JSONResponse
|
||||
if err := json.Unmarshal(bytes, &r); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_ = r
|
||||
}
|
||||
|
||||
func jsonenc(data *JSONResponse) {
|
||||
buf, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_ = buf
|
||||
}
|
||||
|
||||
func BenchmarkJSONEncode(b *testing.B) {
|
||||
jsonbytes := makeJsonBytes()
|
||||
jsondata := makeJsonData(jsonbytes)
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(len(jsonbytes)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
jsonenc(jsondata)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkJSONDecode(b *testing.B) {
|
||||
jsonbytes := makeJsonBytes()
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(len(jsonbytes)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
jsondec(jsonbytes)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,41 +0,0 @@
|
|||
// Copyright 2012 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.
|
||||
|
||||
// This benchmark, taken from the shootuot, tests floating point performance.
|
||||
|
||||
package go1
|
||||
|
||||
import "testing"
|
||||
|
||||
func mandelbrot(n int) int {
|
||||
const Iter = 50
|
||||
const Zero float64 = 0
|
||||
const Limit = 2.0
|
||||
ok := 0
|
||||
for y := 0; y < n; y++ {
|
||||
for x := 0; x < n; x++ {
|
||||
Zr, Zi, Tr, Ti := Zero, Zero, Zero, Zero
|
||||
Cr := (2*float64(x)/float64(n) - 1.5)
|
||||
Ci := (2*float64(y)/float64(n) - 1.0)
|
||||
|
||||
for i := 0; i < Iter && (Tr+Ti <= Limit*Limit); i++ {
|
||||
Zi = 2*Zr*Zi + Ci
|
||||
Zr = Tr - Ti + Cr
|
||||
Tr = Zr * Zr
|
||||
Ti = Zi * Zi
|
||||
}
|
||||
|
||||
if Tr+Ti <= Limit*Limit {
|
||||
ok++
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
func BenchmarkMandelbrot200(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
mandelbrot(200)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
// Copyright 2012 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 go1
|
||||
|
||||
// go parser benchmark based on go/parser/performance_test.go
|
||||
|
||||
import (
|
||||
"compress/bzip2"
|
||||
"encoding/base64"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
parserbytes = makeParserBytes()
|
||||
)
|
||||
|
||||
func makeParserBytes() []byte {
|
||||
var r io.Reader
|
||||
r = strings.NewReader(parserbz2_base64)
|
||||
r = base64.NewDecoder(base64.StdEncoding, r)
|
||||
r = bzip2.NewReader(r)
|
||||
b, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func BenchmarkGoParse(b *testing.B) {
|
||||
b.SetBytes(int64(len(parserbytes)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
if _, err := parser.ParseFile(token.NewFileSet(), "", parserbytes, parser.ParseComments); err != nil {
|
||||
b.Fatalf("benchmark failed due to parse error: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,245 +0,0 @@
|
|||
// Copyright 2012 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.
|
||||
|
||||
// Input for parser benchmark.
|
||||
// This was generated by starting with the contents of
|
||||
// src/pkg/go/parser/parser.go at rev 9b455eb64690, then
|
||||
// compressing with bzip2 -9, then encoding to base64.
|
||||
// We compile the data into the binary so that the benchmark is
|
||||
// a stand-alone binary that can be copied easily from machine to
|
||||
// machine. parser_test.go decodes this during init.
|
||||
|
||||
package go1
|
||||
|
||||
var parserbz2_base64 = "QlpoOTFBWSZTWd3QmOEAIYdfgHwwf//6P7/v/+/////+YEhcAAAB7hwvVWWaZT1X0dt999296z5B" +
|
||||
"3mcQqlBVVVB7hnASWJoFGq9jlHvZHRbdfIB0Hz6fW+jrz4dueD73be6c33tG7la1O9d154ntzzk7" +
|
||||
"jnU+O50zayubCulvgBm7rou5jleOe730dzX2sUbWj1u215X2PBXY17GB3Y3NznVW7ubOuu5a5wHc" +
|
||||
"d9h69Xtatru8+D21uj7bM3lBKd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zXPjwfHd+wQOyGMkj0raTGF7VnkvOqpmpZThtUdNn0VJPsKqbdOUAo16juWVKpvxIwUefdTGVI2W" +
|
||||
"xt5rY2t2viki9JK9xd3SJIkOhySAxWJLCGZb4LrTCT3qPu7MoTJE10zkYWgeyawo1blLhbkKGHiZ" +
|
||||
"SLONHph0Zmnz1cYA3RqHbyrB/NqTf4rxWClAjux9sybomMloiRMm9QlnP6Jj5HvtjsYF7il7l0jX" +
|
||||
"MtL9sUMBEpx91hbl+/jW3jqZXfdEZMIOccK6re+rHGqfbGxjYnnDOe8T4OziLqEn8cDo8U3uZNI9" +
|
||||
"+rZY/1+m9aZrGv2EaunZM0m5cU7X1POp5guRbRg2tot/g+/jYyTAipiYd30IhHmjxz8Zc2rQjdcb" +
|
||||
"5CZdXH3fH4T9H42O/j68ZVXgty63afB3lwUIheY9TdWksCKNItEw8L7kwgGaLvc85h6mRaQPm7YI" +
|
||||
"mYnovikrbjd2eGmWNRN588bS0s7T3WjL59IZlW4eJhSFGPW6EDovZLjfDVL74o92s5lyAyQ4INyq" +
|
||||
"gVzWv/j4aw+H6buyxIjRdfRDyZb+NHWrsD23UhRwlyzY42awYWc6lfzag5F55eStTf9rRhuzVROE" +
|
||||
"jAmYZ2bWlICbSehLazA+NNsC7SnKNbXXUMrObZXU0bFu+phdvVja6/DNCQkzS4XqDWlrDytvLVIO" +
|
||||
"fd2Xj0O24X1z453ylFk/j9ve4lz+B8utfOXokeilpTm1L/zvXc5+pNcY/uLmvZPpsezuc4Z+g7I8" +
|
||||
"lVPy/Et9eH+Y3vZIZe+aB/CTMODCDJOMeDdsmKt29WEjDc9AfZ4u1pPukz03zhZ+vzRdmsXjjreU" +
|
||||
"wgzctKJSRVDe5xLLIZmbgWLsFfHqm+F1I9+nyKo9edkYW3R9Ipo983Z02KIfdeHBkMHHn8DW4nz1" +
|
||||
"+5mgdApk5IURBIgEE7boPGAFYAPquEaBic/Rwmnq20EA1FiEVQjBjJBIBfYUfkDwGbkAZUUtZl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||
"9WZLWNc18Mua2SNpqTx2umteedVqW9zIWW4rAboajE0SBhAcQLS6xZdoLE5myiDDRCnAer5IeqVC" +
|
||||
"p4fZ8tnsnIL0sMgb0WgFSV2D9yOEDOg9ScQ8SeBT9Fu13qH0Ia/TilDH0r7/kCRPayBFqjiF41Pn" +
|
||||
"B+IRYJBzdlB68ANn839DLohhGQB64qMgHpYhQyLpQVEYEQUCwmtEiprwfikV8whevoRXFAgbsEuM" +
|
||||
"IAGJosjS1IzJmtC2QVIJ85D3MhplhRsD2JLlKgZlCBGRTx7OIFoaJDWV1p6ZY2MA3mTkVuTCLvkY" +
|
||||
"B9GQuA5JGEEkAIzNyD7XtQedjp3G16IAZoIFHukAm/wpuNsrbW9+RESIe+yorMlloVIl62QMxK0l" +
|
||||
"JIsGBZaSASHuIqUkoOtNsqdiQ01oDA3qvbA9AFEWBFXviyRgWqSxkWs2irRtSWyo4XBSwbCYjsF0" +
|
||||
"JyEDqA876sc4VAoO4NNd5wAlkHoPthseqcSMzdXvnnuMNy9LCQ76CTonH2SJtAO7mFUwWlkEafWW" +
|
||||
"UJgaipGBIwwcBTZozNJTWvxlhY6P1jTHN1r7qs+a63NG80pJo1FGpCgpWmW9G07U7LmClLJRMtIH" +
|
||||
"+XRZByw0WARSKtIlpEEa++lAsGIXNYJSOdY0GZbMFERKblrWECLFCWULJbSgFSpXyNoOytD3YL90" +
|
||||
"xYSQhlD1QLJLQI0He9BzCEnVUSqicw+8My4R9hISYkJGYIxj8ruAhMajQwXdcJGBSBFRYiEzLDQs" +
|
||||
"CajBMxmCr9tr+pNttLXxe3r5N7djRszWjJLEZs1mapMmmTJTQTNpSqUZsNU0JRlqNljWTbV+p7df" +
|
||||
"Lo0rUkVjdV+CKMDKORHjOxLhIwk9G21jFEYFD4XjWjw8wvyPogFPIeTDwiBloHASYHMk8xALgXwl" +
|
||||
"ATRqLTEQYWQsVkWQUKaMBwo7AQKQfAF3fSVyBBLobqUc9N30Yhd9lPGGxI9LQNomLwZp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IR0WTWmbctjckr7N3VPOru7XMVNk3dt2WIqK02ZudmLFCQkCqp" +
|
||||
"qCyBjGVEdTfF1r7+h+B4O7cou29BYbMh0BFODClliYY5AfJs4+D71Yp7UjPhZjgi333MsPyptUte" +
|
||||
"pFqLJSVa3K525vVziUCCba1HiWF6EI0alvjIt9W7XktfUWvmlum4Kk1aPtoT6dBkB9UaFZ5QZbHG" +
|
||||
"W9Hx/keXtc/nnahU1Y7RoJIXYWFhEDWKe07iby+65oodgnCkf5NWkMTu19eoiz4tB2FkEbAkZFkC" +
|
||||
"QJE2Av9uxj+i4HbYr0Tvi1I5100j8WCciL7h7fGgQTpfTgkJBFPsDsIMZBj5Wy+oD9j+QeOzkqpU" +
|
||||
"q/oD+P02H4E8UHwsrFH7aSsGVsBMw62mEXoSkQ84lgDk6QPTQSKJ6IDuMet75Q5MuoXGTnYascmB" +
|
||||
"kZYOrLA4yQwFTEheZ+Y+BIKiIshoD3MOAx7LfBLUJvRj7KCQhCEoyU2M7LULDIge6lGgjgY1GgVP" +
|
||||
"1KiERIjIAqighIyEC+Xs59Werg1dzsxTVbdmPUHCsMCzELDJzLSojrMVCiDFw8Wmp7p8Vfz5LJrI" +
|
||||
"SQcTIJk0em8ShhFjDJtzeGIl0lZ35N7yVChV+qBCJAjIDCMsy22FjGaitTTZRNUXvy4bk3m7YZ2P" +
|
||||
"WRoBNMYUgOEQMeLhWFF1FeiKoHKwXDHI4GF4EzoogSYlFYVPFwyzgyUiM/HtTQzSwY3/935P/pVS" +
|
||||
"I5ztPxjuSv4UbQOH7cbKdMD1cq9uVWjVUZovZM7cZLxSrw2eWrDGsDgVWAPhYSdXl3xfH0oaTwfb" +
|
||||
"21zqsFhC8NIHdIQSGZveMwM7oSy4ZzP7nD3WnjXGmq73mP93ldP8PvgOpMwbfV1RvR+V/DOnF9rK" +
|
||||
"v9hdyRThQkN3QmOE"
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
// Copyright 2013 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 go1
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"regexp"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// benchmark based on regexp/exec_test.go
|
||||
|
||||
var regexpText []byte
|
||||
|
||||
func makeRegexpText(n int) []byte {
|
||||
rand.Seed(0) // For reproducibility.
|
||||
if len(regexpText) >= n {
|
||||
return regexpText[:n]
|
||||
}
|
||||
regexpText = make([]byte, n)
|
||||
for i := range regexpText {
|
||||
if rand.Intn(30) == 0 {
|
||||
regexpText[i] = '\n'
|
||||
} else {
|
||||
regexpText[i] = byte(rand.Intn(0x7E+1-0x20) + 0x20)
|
||||
}
|
||||
}
|
||||
return regexpText
|
||||
}
|
||||
|
||||
func benchmark(b *testing.B, re string, n int) {
|
||||
r := regexp.MustCompile(re)
|
||||
t := makeRegexpText(n)
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(n))
|
||||
for i := 0; i < b.N; i++ {
|
||||
if r.Match(t) {
|
||||
b.Fatal("match!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
easy0 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ$"
|
||||
easy1 = "A[AB]B[BC]C[CD]D[DE]E[EF]F[FG]G[GH]H[HI]I[IJ]J$"
|
||||
medium = "[XYZ]ABCDEFGHIJKLMNOPQRSTUVWXYZ$"
|
||||
hard = "[ -~]*ABCDEFGHIJKLMNOPQRSTUVWXYZ$"
|
||||
)
|
||||
|
||||
func BenchmarkRegexpMatchEasy0_32(b *testing.B) { benchmark(b, easy0, 32<<0) }
|
||||
func BenchmarkRegexpMatchEasy0_1K(b *testing.B) { benchmark(b, easy0, 1<<10) }
|
||||
func BenchmarkRegexpMatchEasy1_32(b *testing.B) { benchmark(b, easy1, 32<<0) }
|
||||
func BenchmarkRegexpMatchEasy1_1K(b *testing.B) { benchmark(b, easy1, 1<<10) }
|
||||
func BenchmarkRegexpMatchMedium_32(b *testing.B) { benchmark(b, medium, 32<<0) }
|
||||
func BenchmarkRegexpMatchMedium_1K(b *testing.B) { benchmark(b, medium, 1<<10) }
|
||||
func BenchmarkRegexpMatchHard_32(b *testing.B) { benchmark(b, hard, 32<<0) }
|
||||
func BenchmarkRegexpMatchHard_1K(b *testing.B) { benchmark(b, hard, 1<<10) }
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
// Copyright 2011 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.
|
||||
|
||||
// This benchmark, taken from the shootout, tests array indexing
|
||||
// and array bounds elimination performance.
|
||||
|
||||
package go1
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"io"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var revCompTable = [256]uint8{
|
||||
'A': 'T', 'a': 'T',
|
||||
'C': 'G', 'c': 'G',
|
||||
'G': 'C', 'g': 'C',
|
||||
'T': 'A', 't': 'A',
|
||||
'U': 'A', 'u': 'A',
|
||||
'M': 'K', 'm': 'K',
|
||||
'R': 'Y', 'r': 'Y',
|
||||
'W': 'W', 'w': 'W',
|
||||
'S': 'S', 's': 'S',
|
||||
'Y': 'R', 'y': 'R',
|
||||
'K': 'M', 'k': 'M',
|
||||
'V': 'B', 'v': 'B',
|
||||
'H': 'D', 'h': 'D',
|
||||
'D': 'H', 'd': 'H',
|
||||
'B': 'V', 'b': 'V',
|
||||
'N': 'N', 'n': 'N',
|
||||
}
|
||||
|
||||
func revcomp(data []byte) {
|
||||
in := bufio.NewReader(bytes.NewBuffer(data))
|
||||
out := io.Discard
|
||||
buf := make([]byte, 1024*1024)
|
||||
line, err := in.ReadSlice('\n')
|
||||
for err == nil {
|
||||
out.Write(line)
|
||||
|
||||
// Accumulate reversed complement in buf[w:]
|
||||
nchar := 0
|
||||
w := len(buf)
|
||||
for {
|
||||
line, err = in.ReadSlice('\n')
|
||||
if err != nil || line[0] == '>' {
|
||||
break
|
||||
}
|
||||
line = line[0 : len(line)-1]
|
||||
nchar += len(line)
|
||||
if len(line)+nchar/60+128 >= w {
|
||||
nbuf := make([]byte, len(buf)*5)
|
||||
copy(nbuf[len(nbuf)-len(buf):], buf)
|
||||
w += len(nbuf) - len(buf)
|
||||
buf = nbuf
|
||||
}
|
||||
|
||||
// This loop is the bottleneck.
|
||||
for _, c := range line {
|
||||
w--
|
||||
buf[w] = revCompTable[c]
|
||||
}
|
||||
}
|
||||
|
||||
// Copy down to beginning of buffer, inserting newlines.
|
||||
// The loop left room for the newlines and 128 bytes of padding.
|
||||
i := 0
|
||||
for j := w; j < len(buf); j += 60 {
|
||||
n := copy(buf[i:i+60], buf[j:])
|
||||
buf[i+n] = '\n'
|
||||
i += n + 1
|
||||
}
|
||||
out.Write(buf[0:i])
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkRevcomp(b *testing.B) {
|
||||
bytes := makefasta()
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(len(bytes)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
revcomp(bytes)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
// Copyright 2011 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.
|
||||
|
||||
// This benchmark tests text/template throughput,
|
||||
// converting a large data structure with a simple template.
|
||||
|
||||
package go1
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
// After removing \t and \n this generates identical output to
|
||||
// json.Marshal, making it easy to test for correctness.
|
||||
const tmplText = `
|
||||
{
|
||||
"tree":{{template "node" .Tree}},
|
||||
"username":"{{.Username}}"
|
||||
}
|
||||
{{define "node"}}
|
||||
{
|
||||
"name":"{{.Name}}",
|
||||
"kids":[
|
||||
{{range $i, $k := .Kids}}
|
||||
{{if $i}}
|
||||
,
|
||||
{{end}}
|
||||
{{template "node" $k}}
|
||||
{{end}}
|
||||
],
|
||||
"cl_weight":{{.CLWeight}},
|
||||
"touches":{{.Touches}},
|
||||
"min_t":{{.MinT}},
|
||||
"max_t":{{.MaxT}},
|
||||
"mean_t":{{.MeanT}}
|
||||
}
|
||||
{{end}}
|
||||
`
|
||||
|
||||
func stripTabNL(r rune) rune {
|
||||
if r == '\t' || r == '\n' {
|
||||
return -1
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func makeTemplate(jsonbytes []byte, jsondata *JSONResponse) *template.Template {
|
||||
tmpl := template.Must(template.New("main").Parse(strings.Map(stripTabNL, tmplText)))
|
||||
|
||||
var buf bytes.Buffer
|
||||
if err := tmpl.Execute(&buf, &jsondata); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if !bytes.Equal(buf.Bytes(), jsonbytes) {
|
||||
println(buf.Len(), len(jsonbytes))
|
||||
panic("wrong output")
|
||||
}
|
||||
return tmpl
|
||||
}
|
||||
|
||||
func tmplexec(tmpl *template.Template, jsondata *JSONResponse) {
|
||||
if err := tmpl.Execute(io.Discard, jsondata); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkTemplate(b *testing.B) {
|
||||
jsonbytes := makeJsonBytes()
|
||||
jsondata := makeJsonData(jsonbytes)
|
||||
tmpl := makeTemplate(jsonbytes, jsondata)
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(len(jsonbytes)))
|
||||
for i := 0; i < b.N; i++ {
|
||||
tmplexec(tmpl, jsondata)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright 2013 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 go1
|
||||
|
||||
// benchmark based on time/time_test.go
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func BenchmarkTimeParse(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
time.Parse(time.ANSIC, "Mon Jan 2 15:04:05 2006")
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkTimeFormat(b *testing.B) {
|
||||
t := time.Unix(1265346057, 0)
|
||||
for i := 0; i < b.N; i++ {
|
||||
t.Format("Mon Jan 2 15:04:05 2006")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue