Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It take a long time to compute when changing ZipfianConstant #301

Open
Fischer0522 opened this issue Jul 26, 2024 · 0 comments
Open

It take a long time to compute when changing ZipfianConstant #301

Fischer0522 opened this issue Jul 26, 2024 · 0 comments

Comments

@Fischer0522
Copy link

Here is my workload for a custom kv store:

recordcount=10000
operationcount=10000
workload=core

readallfields=true

readproportion=0.5
updateproportion=0.5
scanproportion=0
insertproportion=0

requestdistribution=zipfian

When testing the performance of my kvstore for handling data skew, I noticed in generator/zipfian.go that the comments stated, "be aware: initializing this generator may take a long time if there are lots of items to choose from (e.g. over a minute for 100 million objects)." However, when I changed ZipfianConstant from 0.99 to 0.5, it took almost 10 minutes to prepare the data, which seems much slower than described.

I also noticed that most of the time was spent on the zetaStatic function, and n (i.e., itemCount) is a huge number. If I want to make it faster, can I just use a smaller n (itemCount)? Will this affect correctness?

func zetaStatic(st int64, n int64, theta float64, initialSum float64) float64 {
	sum := initialSum

	for i := st; i < n; i++ {
		sum += 1 / math.Pow(float64(i+1), theta)
	}

	return sum
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant