~badt/glavar

5fdf23346726bef4f92960b2946e7f34e21b4410 — Ian P Badtrousers 3 years ago 841f9eb
fthinoporo: more insight
1 files changed, 5 insertions(+), 3 deletions(-)

M fthinoporo/index.go
M fthinoporo/index.go => fthinoporo/index.go +5 -3
@@ 37,6 37,7 @@ func index() {
	cpu := runtime.NumCPU()
	fmt.Println("cpu count:", cpu)

	var start time.Time
	for i := 0; i < cpu; i++ {
		go func(i int) {
			n := 0


@@ 46,14 47,15 @@ func index() {
				N++

				if rand.Intn(1000) == 7 {
					fmt.Printf("[%d] %d indexed, %d total\n",
						i, n, N)
					fmt.Printf("[%v] indexed:%d, total:%d\n",
						time.Now().Sub(start), n, N)
				}
			}
		}(i)
	}

	fmt.Println("loading data")
	start = time.Now()
	for data.Next() {
		var m M
		err = data.Scan(&m.T, &m.Login, &m.Text)


@@ 64,7 66,7 @@ func index() {
		pipe <- m
		if rand.Intn(1000) == 7 {
			t := time.Unix(0, m.T).Format(time.RFC822)
			fmt.Printf("[∆] %v\n", t)
			fmt.Println(t)
		}
	}