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

Optimize _clear() #680

Closed
5 tasks done
vweevers opened this issue Oct 11, 2019 · 0 comments · Fixed by #784
Closed
5 tasks done

Optimize _clear() #680

vweevers opened this issue Oct 11, 2019 · 0 comments · Fixed by #784
Labels
semver-patch Bug fixes that are backward compatible

Comments

@vweevers
Copy link
Member

vweevers commented Oct 11, 2019

The clear() method currently uses a JS-land iterator, which is inefficient. We can instead iterate and delete in C++. Rough plan to get there:

  • Refactor this to avoid a repeated delete start, by doing the logic in reverse, and remove the need for this by using an std::string for start
  • Reuse that code to create an iterator
  • Maybe merge the code that does initial seek with code that does manual seek
  • Write ClearWorker
  • Write NAPI_METHOD(db_clear)

Ref Level/community#79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Bug fixes that are backward compatible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant