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
1fce1043
Commit
1fce1043
authored
Sep 06, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0e74a2e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
go/neo/t/t.sh
go/neo/t/t.sh
+5
-3
go/neo/t/zsha1.go
go/neo/t/zsha1.go
+17
-15
No files found.
go/neo/t/t.sh
View file @
1fce1043
...
@@ -182,7 +182,9 @@ EOF
...
@@ -182,7 +182,9 @@ EOF
export
WENDELIN_CORE_ZBLK_FMT
=
ZBlk1
export
WENDELIN_CORE_ZBLK_FMT
=
ZBlk1
# XXX 32 temp - raise
# XXX 32 temp - raise
work
=
32
# array size generated (MB)
#work=32 # array size generated (MB)
work
=
64
#work=512 # array size generated (MB)
# generate data in data.fs
# generate data in data.fs
GENfs
()
{
GENfs
()
{
...
@@ -223,8 +225,8 @@ GENsql() {
...
@@ -223,8 +225,8 @@ GENsql() {
# ---- main driver ----
# ---- main driver ----
GENfs
GENfs
GENsqlite
#
GENsqlite
GENsql
#
GENsql
wait
wait
sync
sync
...
...
go/neo/t/zsha1.go
View file @
1fce1043
...
@@ -69,26 +69,27 @@ func zsha1(ctx context.Context, url string, useprefetch bool) (err error) {
...
@@ -69,26 +69,27 @@ func zsha1(ctx context.Context, url string, useprefetch bool) (err error) {
}
}
// prefetchBlk prefetches block of 512 objects starting from xid
// prefetchBlk prefetches block of 512 objects starting from xid
var
tprevLoadBlkStart
time
.
Time
//
var tprevLoadBlkStart time.Time
prefetchBlk
:=
func
(
ctx
context
.
Context
,
xid
zodb
.
Xid
)
{
prefetchBlk
:=
func
(
ctx
context
.
Context
,
xid
zodb
.
Xid
)
{
if
cache
==
nil
{
if
cache
==
nil
{
return
return
}
}
t1
:=
time
.
Now
()
//t1 := time.Now()
for
i
:=
0
;
i
<
512
;
i
++
{
//for i := 0; i < 512; i++ {
for
i
:=
0
;
i
<
8
;
i
++
{
prefetch
(
ctx
,
xid
)
prefetch
(
ctx
,
xid
)
xid
.
Oid
++
xid
.
Oid
++
}
}
t2
:=
time
.
Now
()
//
t2 := time.Now()
δt
:=
t2
.
Sub
(
t1
)
//
δt := t2.Sub(t1)
fmt
.
Printf
(
"tprefetch: %s"
,
δt
)
//
fmt.Printf("tprefetch: %s", δt)
if
!
tprevLoadBlkStart
.
IsZero
()
{
//
if !tprevLoadBlkStart.IsZero() {
fmt
.
Printf
(
"
\t
tprevload: %s"
,
t1
.
Sub
(
tprevLoadBlkStart
))
//
fmt.Printf("\ttprevload: %s", t1.Sub(tprevLoadBlkStart))
}
//
}
fmt
.
Printf
(
"
\n
"
)
//
fmt.Printf("\n")
//
tprevLoadBlkStart
=
t2
//
tprevLoadBlkStart = t2
}
}
...
@@ -99,8 +100,8 @@ func zsha1(ctx context.Context, url string, useprefetch bool) (err error) {
...
@@ -99,8 +100,8 @@ func zsha1(ctx context.Context, url string, useprefetch bool) (err error) {
}
}
before
:=
lastTid
+
1
// XXX overflow ?
before
:=
lastTid
+
1
// XXX overflow ?
if
fals
e
{
if
tru
e
{
defer
profile
.
Start
()
.
Stop
()
defer
profile
.
Start
(
profile
.
TraceProfile
)
.
Stop
()
}
}
tstart
:=
time
.
Now
()
tstart
:=
time
.
Now
()
...
@@ -111,7 +112,8 @@ func zsha1(ctx context.Context, url string, useprefetch bool) (err error) {
...
@@ -111,7 +112,8 @@ func zsha1(ctx context.Context, url string, useprefetch bool) (err error) {
loop
:
loop
:
for
{
for
{
xid
:=
zodb
.
Xid
{
Oid
:
oid
,
XTid
:
zodb
.
XTid
{
Tid
:
before
,
TidBefore
:
true
}}
xid
:=
zodb
.
Xid
{
Oid
:
oid
,
XTid
:
zodb
.
XTid
{
Tid
:
before
,
TidBefore
:
true
}}
if
xid
.
Oid
%
512
==
0
{
//if xid.Oid % 512 == 0 {
if
xid
.
Oid
%
8
==
0
{
prefetchBlk
(
ctx
,
xid
)
prefetchBlk
(
ctx
,
xid
)
}
}
data
,
_
,
err
:=
load
(
ctx
,
xid
)
data
,
_
,
err
:=
load
(
ctx
,
xid
)
...
...
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