Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/pkg/testing/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