func validateEqual(d *llrb.Dict, rb llrb.MemStore) { refKeys := make([]*llrb.KeyInt, 0) fmt.Printf("number of elements {dict: %v, api:%v}\n", d.Len(), rb.Len()) rb.Range(nil, nil, "both", func(k llrb.Item) bool { refKeys = append(refKeys, k.(*llrb.KeyInt)) return true }) keys := make([]*llrb.KeyInt, 0) d.Range(nil, nil, "both", func(k llrb.Item) bool { keys = append(keys, k.(*llrb.KeyInt)) return true }) if reflect.DeepEqual(refKeys, keys) == false { log.Fatalf("final Dict keys and LLRB keys mismatch\n") } }
func benchRange(s llrb.MemStore) { for i := 0; i < options.bcount; i++ { s.Range(nil, nil, "both", nil) } }