Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
94d79c29
Commit
94d79c29
authored
Oct 13, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X neo/server: benchmark parallel client requests over same link
parent
9cab8f1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
6 deletions
+38
-6
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+38
-6
No files found.
go/neo/server/cluster_test.go
View file @
94d79c29
...
@@ -553,7 +553,7 @@ func TestMasterStorage(t *testing.T) {
...
@@ -553,7 +553,7 @@ func TestMasterStorage(t *testing.T) {
}
}
func
benchmarkGetObject
(
b
*
testing
.
B
,
Mnet
,
Snet
,
Cnet
xnet
.
Networker
)
{
func
benchmarkGetObject
(
b
*
testing
.
B
,
Mnet
,
Snet
,
Cnet
xnet
.
Networker
,
benchit
func
(
xcload1
func
())
)
{
// create test cluster <- XXX factor to utility func
// create test cluster <- XXX factor to utility func
zstor
:=
xfs1stor
(
"../../zodb/storage/fs1/testdata/1.fs"
)
zstor
:=
xfs1stor
(
"../../zodb/storage/fs1/testdata/1.fs"
)
...
@@ -638,9 +638,28 @@ func benchmarkGetObject(b *testing.B, Mnet, Snet, Cnet xnet.Networker) {
...
@@ -638,9 +638,28 @@ func benchmarkGetObject(b *testing.B, Mnet, Snet, Cnet xnet.Networker) {
// now start the benchmark
// now start the benchmark
b
.
ResetTimer
()
b
.
ResetTimer
()
benchit
(
xcload1
)
}
func
benchmarkGetObjectSerial
(
b
*
testing
.
B
,
Mnet
,
Snet
,
Cnet
xnet
.
Networker
)
{
benchmarkGetObject
(
b
,
Mnet
,
Snet
,
Cnet
,
func
(
xcload1
func
())
{
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
xcload1
()
xcload1
()
}
}
})
}
func
benchmarkGetObjectParallel
(
b
*
testing
.
B
,
Mnet
,
Snet
,
Cnet
xnet
.
Networker
)
{
benchmarkGetObject
(
b
,
Mnet
,
Snet
,
Cnet
,
func
(
xcload1
func
())
{
//println()
b
.
SetParallelism
(
32
)
// we are io-bound
b
.
RunParallel
(
func
(
pb
*
testing
.
PB
)
{
//print(".")
for
pb
.
Next
()
{
xcload1
()
}
})
})
}
}
func
BenchmarkGetObjectNetPipe
(
b
*
testing
.
B
)
{
func
BenchmarkGetObjectNetPipe
(
b
*
testing
.
B
)
{
...
@@ -648,10 +667,23 @@ func BenchmarkGetObjectNetPipe(b *testing.B) {
...
@@ -648,10 +667,23 @@ func BenchmarkGetObjectNetPipe(b *testing.B) {
Mhost
:=
net
.
Host
(
"m"
)
Mhost
:=
net
.
Host
(
"m"
)
Shost
:=
net
.
Host
(
"s"
)
Shost
:=
net
.
Host
(
"s"
)
Chost
:=
net
.
Host
(
"c"
)
Chost
:=
net
.
Host
(
"c"
)
benchmarkGetObject
(
b
,
Mhost
,
Shost
,
Chost
)
benchmarkGetObjectSerial
(
b
,
Mhost
,
Shost
,
Chost
)
}
func
BenchmarkGetObjectNetPipeParallel
(
b
*
testing
.
B
)
{
net
:=
pipenet
.
New
(
"testnet"
)
Mhost
:=
net
.
Host
(
"m"
)
Shost
:=
net
.
Host
(
"s"
)
Chost
:=
net
.
Host
(
"c"
)
benchmarkGetObjectParallel
(
b
,
Mhost
,
Shost
,
Chost
)
}
}
func
BenchmarkGetObjectTCPlo
(
b
*
testing
.
B
)
{
func
BenchmarkGetObjectTCPlo
(
b
*
testing
.
B
)
{
net
:=
xnet
.
NetPlain
(
"tcp"
)
net
:=
xnet
.
NetPlain
(
"tcp"
)
benchmarkGetObject
(
b
,
net
,
net
,
net
)
benchmarkGetObjectSerial
(
b
,
net
,
net
,
net
)
}
func
BenchmarkGetObjectTCPloParallel
(
b
*
testing
.
B
)
{
net
:=
xnet
.
NetPlain
(
"tcp"
)
benchmarkGetObjectParallel
(
b
,
net
,
net
,
net
)
}
}
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