Skip to content

Avoid directory traversal on every operation #730

Description

@franco-ruggeri

Description

Currently, it seems that every zk command triggers a full filepath.Walk of the notebook directory before executing. This is used to detect new, modified, and deleted notes. However, a full walk is very expensive on large network-mounted filesystems. It would be great to avoid such traversals. This could be enabled with a new configuration option.

For example, assuming notes are created with zk, each zk operation would just need to refresh the index without any full walk. For every note in the index:

  • If it exists, check the last modification time. If the note was modified since the last refresh, parse it again.
  • If it doesn't exist, it was deleted, so remove it from the index.

I personally keep my notes together with the rest of my files, ~1.5 TB of cloud storage. With this setup, full walks are unfortunately super slow and make the tool unusable.

Do I plan to submit a PR for this?

  • No
  • Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureSomething is missing

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions