Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
b379b32f
Commit
b379b32f
authored
Aug 08, 2013
by
Brad Fitzpatrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/api: add a benchmark over the standard library
R=golang-dev, gri CC=golang-dev
https://golang.org/cl/12603045
parent
36703370
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
goapi_test.go
src/cmd/api/goapi_test.go
+27
-0
No files found.
src/cmd/api/goapi_test.go
View file @
b379b32f
...
...
@@ -10,8 +10,10 @@ import (
"bytes"
"flag"
"fmt"
"go/build"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
...
...
@@ -139,3 +141,28 @@ func TestCompareAPI(t *testing.T) {
}
}
}
func
BenchmarkAll
(
b
*
testing
.
B
)
{
stds
,
err
:=
exec
.
Command
(
"go"
,
"list"
,
"std"
)
.
Output
()
if
err
!=
nil
{
b
.
Fatal
(
err
)
}
b
.
ResetTimer
()
pkgNames
:=
strings
.
Fields
(
string
(
stds
))
for
_
,
c
:=
range
contexts
{
c
.
Compiler
=
build
.
Default
.
Compiler
}
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
for
_
,
context
:=
range
contexts
{
w
:=
NewWalker
(
context
,
filepath
.
Join
(
build
.
Default
.
GOROOT
,
"src/pkg"
))
for
_
,
name
:=
range
pkgNames
{
if
name
!=
"unsafe"
&&
!
strings
.
HasPrefix
(
name
,
"cmd/"
)
{
w
.
export
(
w
.
Import
(
name
))
}
}
w
.
Features
()
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment