Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.
/ leveldown Public archive
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Optimize _clear() #680

@vweevers

Description

@vweevers

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    semver-patchBug fixes that are backward compatible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions