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
da833474
Commit
da833474
authored
Mar 03, 2011
by
Roger Peppe
Committed by
Rob Pike
Mar 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing: run GC before each benchmark run.
R=r, rh, gri, rsc CC=golang-dev
https://golang.org/cl/4237055
parent
5bd284e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
benchmark.go
src/pkg/testing/benchmark.go
+4
-0
No files found.
src/pkg/testing/benchmark.go
View file @
da833474
...
...
@@ -8,6 +8,7 @@ import (
"flag"
"fmt"
"os"
"runtime"
"time"
)
...
...
@@ -64,6 +65,9 @@ func (b *B) nsPerOp() int64 {
// runN runs a single benchmark for the specified number of iterations.
func
(
b
*
B
)
runN
(
n
int
)
{
// Try to get a comparable environment for each run
// by clearing garbage from previous runs.
runtime
.
GC
()
b
.
N
=
n
b
.
ResetTimer
()
b
.
StartTimer
()
...
...
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