Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
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
Levin Zimmermann
go-fuse
Commits
a55a3b79
Commit
a55a3b79
authored
May 26, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make benchmark less chatty.
parent
5bb5947a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
benchmark/benchmark.go
benchmark/benchmark.go
+4
-6
benchmark/stat_test.go
benchmark/stat_test.go
+2
-2
No files found.
benchmark/benchmark.go
View file @
a55a3b79
...
...
@@ -43,8 +43,6 @@ func ReadLines(name string) []string {
func
BulkStat
(
parallelism
int
,
files
[]
string
)
float64
{
todo
:=
make
(
chan
string
,
len
(
files
))
dts
:=
make
(
chan
time
.
Duration
,
parallelism
)
fmt
.
Printf
(
"Statting %d files with %d threads
\n
"
,
len
(
files
),
parallelism
)
for
i
:=
0
;
i
<
parallelism
;
i
++
{
go
func
()
{
t
:=
time
.
Now
()
...
...
@@ -108,11 +106,11 @@ func AnalyzeBenchmarkRuns(label string, times []float64) {
fmt
.
Printf
(
"%s: %d samples
\n
"
+
"avg %.3fms 2sigma %.3fms "
+
"median %.3fms
\n
"
+
"10%%tile %.3fms, 90%%tile %.3fms
\n
"
,
"avg %.3fms +/- %.0f%% "
+
"median %.3fms, 10%%tiles: [-%.0f%%, +%.0f%%]
\n
"
,
label
,
len
(
times
),
avg
,
2
*
stddev
,
median
,
perc10
,
perc90
)
len
(
times
),
avg
,
100.0
*
2
*
stddev
/
avg
,
median
,
100
*
(
median
-
perc10
)
/
median
,
100
*
(
perc90
-
median
)
/
median
)
}
func
RunBulkStat
(
runs
int
,
threads
int
,
sleepTime
time
.
Duration
,
files
[]
string
)
(
results
[]
float64
)
{
...
...
benchmark/stat_test.go
View file @
a55a3b79
...
...
@@ -101,7 +101,7 @@ func BenchmarkGoFuseThreadedStat(b *testing.B) {
threads
:=
runtime
.
GOMAXPROCS
(
0
)
results
:=
TestingBOnePass
(
b
,
threads
,
files
)
AnalyzeBenchmarkRuns
(
"Go-FUSE"
,
results
)
AnalyzeBenchmarkRuns
(
fmt
.
Sprintf
(
"Go-FUSE %d CPUs"
,
threads
)
,
results
)
}
func
TestingBOnePass
(
b
*
testing
.
B
,
threads
int
,
files
[]
string
)
(
results
[]
float64
)
{
...
...
@@ -174,5 +174,5 @@ func BenchmarkCFuseThreadedStat(b *testing.B) {
os
.
Lstat
(
mountPoint
)
threads
:=
runtime
.
GOMAXPROCS
(
0
)
results
:=
TestingBOnePass
(
b
,
threads
,
lines
)
AnalyzeBenchmarkRuns
(
"CFuse"
,
results
)
AnalyzeBenchmarkRuns
(
fmt
.
Sprintf
(
"CFuse on %d CPUS"
,
threads
)
,
results
)
}
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