Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
testV := TestValue{
A: 1,
B: 1,
C: 3,
D: "packagemainimport(\\\"bufio\\\"\\\"fmt\\\"\\\"github.com/whuanle/lsm\\\"\\\"github.com/whuanle/lsm/config\\\"\\\"os\\\"\\\"time\\\")typeTestValuestruct{Aint64Bint64Cint64Dstring}funcmain(){deferfunc(){r:=recover()ifr!=nil{fmt.Println(r)inputReader:=bufio.NewReader(os.Stdin)_,_=inputReader.ReadString('\\\\n')}}()lsm.Start(config.Config{DataDir:`E:\\\\项目\\\\lsm数据测试目录`,Level0Size:100,PartSize:4,Threshold:20000,})//64个字节testV:=TestValue{A:1,B:1,C:3,D:\\\"packagemainimport(\\\\\\\\\\\\\\\"bufio\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"fmt\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"github.com/whuanle/lsm\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"github.com/whuanle/lsm/config\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"os\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"time\\\\\\\\\\\\\\\")typeTestValuestruct{Aint64Bint64Cint64Dstring}funcmain(){deferfunc(){r:=recover()ifr!=nil{fmt.Println(r)inputReader:=bufio.NewReader(os.Stdin)_,_=inputReader.ReadString('\\\\\\\\\\\\\\\\n')}}()lsm.Start(config.Config{DataDir:`E:\\\\\\\\\\\\\\\\项目\\\\\\\\\\\\\\\\lsm数据测试目录`,Level0Size:1,PartSize:4,Threshold:500,})//64个字节testV:=TestValue{A:1,B:1,C:3,D:\\\\\\\\\\\\\\\"00000000000000000000000000000000000000\\\\\\\\\\\\\\\",}count:=0start:=time.Now()key:=[]byte{'a','a','a','a','a','a'}lsm.Set(string(key),testV)fora:=0;a<26;a++{forb:=0;b<26;b++{forc:=0;c<26;c++{ford:=0;d<26;d++{fore:=0;e<26;e++{forf:=0;f<26;f++{key[0]='a'+byte(a)key[1]='a'+byte(b)key[2]='a'+byte(c)key[3]='a'+byte(d)key[4]='a'+byte(e)key[5]='a'+byte(f)lsm.Set(string(key),testV)count++}}}}}}elapse:=time.Since(start)fmt.Println(\\\\\\\\\\\\\\\"插入完成,数据量:\\\\\\\\\\\\\\\",count,\\\\\\\\\\\\\\\",消耗时间:\\\\\\\\\\\\\\\",elapse)inputReader:=bufio.NewReader(os.Stdin)_,_=inputReader.ReadString('\\\\\\\\\\\\\\\\n')}\\\",}count:=0start:=time.Now()key:=[]byte{'a','a','a','a','a','a'}lsm.Set(string(key),testV)fora:=0;a<1;a++{forb:=0;b<1;b++{forc:=0;c<26;c++{ford:=0;d<26;d++{fore:=0;e<26;e++{forf:=0;f<26;f++{key[0]='a'+byte(a)key[1]='a'+byte(b)key[2]='a'+byte(c)key[3]='a'+byte(d)key[4]='a'+byte(e)key[5]='a'+byte(f)lsm.Set(string(key),testV)count++}}}}}}elapse:=time.Since(start)fmt.Println(\\\"插入完成,数据量:\\\",count,\\\",消耗时间:\\\",elapse)inputReader:=bufio.NewReader(os.Stdin)_,_=inputReader.ReadString('\\\\n')}",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment