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

iterator performance #82

Closed
whyrusleeping opened this issue Jun 28, 2017 · 4 comments
Closed

iterator performance #82

whyrusleeping opened this issue Jun 28, 2017 · 4 comments
Assignees
Labels
kind/enhancement Something could be better.

Comments

@whyrusleeping
Copy link

Trying this out, and i'm quite happy with read and write performance, but i've noticed that iterating through items in the datastore is significantly slower than what we're currently using. Is there going to be work on improving that performance?

@manishrjain
Copy link
Contributor

Yeah, sorted key-value iteration is slow. We just haven't been able to get the same kind of read throughput from Go as expected. I wanted to try building an async io library in Go, but haven't had a chance. Might do it soon.

There're 2 ways to achieve performance with iteration:

  • If you don't need values for all the keys, then Iterate only over keys, and retrieve values separately.
  • If you don't care about sorted iteration, we could build an API which would give you keys and values in random order really fast.

@manishrjain manishrjain self-assigned this Jun 28, 2017
@manishrjain manishrjain added the kind/enhancement Something could be better. label Jun 28, 2017
@whyrusleeping
Copy link
Author

Yeah, i don't really care about it being sorted, and i also don't care about values. If we could get a fast iteration of unordered keys, that would be really great

@manishrjain
Copy link
Contributor

manishrjain commented Jun 29, 2017

You can just set FetchValues option when creating iterator to false. It would iterate over keys in sorted order blazing fast.

Try it out. And if it gives you the performance you want, feel free to close this issue.

@manishrjain
Copy link
Contributor

I presume this is working for you. Feel free to reopen if it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Something could be better.
Development

No branches or pull requests

2 participants