Commit 1fce1043 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0e74a2e1
...@@ -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
......
...@@ -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("\ttprevload: %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 false { if true {
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment