summaryrefslogtreecommitdiff
path: root/go/src/cow-dedupe/dedupe.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@beefcake.parabola.nu>2018-05-19 02:20:59 -0400
committerLuke Shumaker <lukeshu@beefcake.parabola.nu>2018-05-19 02:20:59 -0400
commit383e075a62ca4e4250c1d652913c4de375a03bc5 (patch)
tree9f3e788076c18e2a11c6ff8c9b9c9f84bede1308 /go/src/cow-dedupe/dedupe.go
parent86201baa1bf72f9717fc4643cd0a00554a23bd72 (diff)
async status line
Diffstat (limited to 'go/src/cow-dedupe/dedupe.go')
-rw-r--r--go/src/cow-dedupe/dedupe.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/go/src/cow-dedupe/dedupe.go b/go/src/cow-dedupe/dedupe.go
index 9fee970..62fd85d 100644
--- a/go/src/cow-dedupe/dedupe.go
+++ b/go/src/cow-dedupe/dedupe.go
@@ -10,6 +10,7 @@ import (
"runtime"
"strconv"
"strings"
+ "time"
"lib/statusline"
)
@@ -34,7 +35,7 @@ func getFiemaps(paths []string) map[string][]string {
ret := map[string][]string{}
- sl := statusline.NewStatusLine(os.Stderr)
+ sl := statusline.NewAsyncStatusLine(os.Stderr, time.Second/2)
cnt := 0
sl.Put("Mapping extents...")
@@ -77,7 +78,7 @@ func getFiemaps(paths []string) map[string][]string {
func getChecksums(paths []string) map[string][]string {
ret := map[string][]string{}
- sl := statusline.NewStatusLine(os.Stderr)
+ sl := statusline.NewAsyncStatusLine(os.Stderr, time.Second/2)
cnt := 0
sl.Put(fmt.Sprintf("Generating checksums for files... %d/%d\n", cnt, len(paths)))
@@ -128,7 +129,7 @@ func getChecksums(paths []string) map[string][]string {
func main() {
// we have low parallelism, don't let syscalls fan-out weird
// on many-core systems
- runtime.GOMAXPROCS(1)
+ runtime.GOMAXPROCS(2)
fiemap2filenames := getFiemaps(os.Args[1:])