Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kmrmt committed Sep 27, 2023
1 parent c5dfbdf commit 0755e0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cmd/tools/cli/benchmark/core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func main() {
})

ids := make([]uint, len(vectors))
run(ctx, false, path, len(vectors[0]), vectors, ids, time.Hour*2, output)
run(ctx, false, path, len(vectors[0]), vectors, ids, time.Hour*1, output)
sleep(ctx, time.Second*5, time.Minute*4, func() {
output("waiting for next")
}, func() {
Expand All @@ -297,16 +297,16 @@ func main() {
time.Sleep(time.Minute)
output("starting")
})
run(ctx, true, path, len(vectors[0]), nil, nil, 0, output)
sleep(ctx, time.Second*5, time.Minute*4, func() {
output("waiting for next")
}, func() {
runtime.GC()
output("gc")
time.Sleep(time.Minute)
output("starting")
})
run(ctx, true, path, len(vectors[0]), vectors, ids, time.Hour*2, output)
// run(ctx, true, path, len(vectors[0]), nil, nil, 0, output)
// sleep(ctx, time.Second*5, time.Minute*4, func() {
// output("waiting for next")
// }, func() {
// runtime.GC()
// output("gc")
// time.Sleep(time.Minute)
// output("starting")
// })
// run(ctx, true, path, len(vectors[0]), vectors, ids, time.Hour*2, output)

ids = ids[:0:0]
ids = nil
Expand Down
2 changes: 2 additions & 0 deletions internal/core/algorithm/ngt/ngt.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"context"
"reflect"
"sync/atomic"
"time"
"unsafe"

"github.com/vdaas/vald/internal/core/algorithm"
Expand Down Expand Up @@ -626,6 +627,7 @@ func (n *ngt) CreateIndex(poolSize uint32) error {
}
n.lock(true)
ret := func(poolSize uint32) int {
time.Sleep(2 * time.Second)
return 1
}(poolSize)
n.unlock(true)
Expand Down

0 comments on commit 0755e0d

Please sign in to comment.