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
65cfa007
Commit
65cfa007
authored
Jan 12, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bb90dc01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
go/neo/t/tzodb.go
go/neo/t/tzodb.go
+6
-7
No files found.
go/neo/t/tzodb.go
View file @
65cfa007
// Copyright (C) 2017-20
19
Nexedi SA and Contributors.
// Copyright (C) 2017-20
20
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
...
...
@@ -38,10 +38,9 @@ import (
"testing"
"time"
"golang.org/x/sync/errgroup"
"lab.nexedi.com/kirr/go123/prog"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xsync"
"lab.nexedi.com/kirr/neo/go/internal/log"
"lab.nexedi.com/kirr/neo/go/internal/task"
...
...
@@ -323,14 +322,14 @@ func zwrk(ctx context.Context, url string, nwrk int, h hasher, bench, check stri
// benchmark parallel loads
defer
task
.
Runningf
(
&
ctx
,
"zwrk-%d/bench"
,
nwrk
)(
&
err
)
r
:=
testing
.
Benchmark
(
func
(
b
*
testing
.
B
)
{
wg
,
ctx
:=
errgroup
.
WithContext
(
ctx
)
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
var
n
int64
for
i
:=
0
;
i
<
nwrk
;
i
++
{
stor
:=
storv
[
i
]
oid
:=
zodb
.
Oid
(
0
)
wg
.
Go
(
func
()
error
{
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
for
{
n
:=
atomic
.
AddInt64
(
&
n
,
+
1
)
if
n
>=
int64
(
b
.
N
)
{
...
...
@@ -383,10 +382,10 @@ func zwrkPreconnect(ctx context.Context, url string, at zodb.Tid, nwrk int) (_ [
defer
task
.
Runningf
(
&
ctx
,
"zwrk-%d/preconnect"
,
nwrk
)(
&
err
)
storv
:=
make
([]
zodb
.
IStorage
,
nwrk
)
wg
,
ctx
:=
errgroup
.
WithContext
(
ctx
)
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
for
i
:=
0
;
i
<
nwrk
;
i
++
{
i
:=
i
wg
.
Go
(
func
()
error
{
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
// open storage without caching - we need to take
// latency of every request into account, and a cache
// could be inhibiting (e.g. making significantly
...
...
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