Hello,
Am benchmarking the performance between GO ,C++ and Python with Couchbase .
Can anyone please help me to understand the GO read document behaviour ? Insert operation is taking around 28sec ,however read operation is also taking the same time. . I have used only simple get function as below ,no other functions called .
function main()
{
var bucket *gocb.Bucket
bucket, err = cluster.OpenBucket(configuration.BucketName, "") //Connects to the bucket
var readCount int64 = 0
var readproportion int
var opsSequence[100] int
for i :=0; i < 5; i++ {
for j :=0; j < 100000; j++ { //NumofDoc : 250000
k := j%100;
optype := opsSequence[k];
var x int = int(readCount % 5000);
test := "Go_Demo_"+"_"+strconv.Itoa(x)
getDocument(bucket,test)
readCount++;
}
}
}
func getDocument(bucket *gocb.Bucket,documentId string) {
var get_data Interface{}
_, error := bucket.Get(documentId, &get_data)
if error != nil {
fmt.Println(error.Error())
return
}
Whereas In C++ and Python read document time is half of the time of Insert documents ( if write takes 30sec then read taking 15secs) . As per my observation on these tests read should be faster than write , but in GO am not getting the expected results.