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

Cache all entries to calculate index #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

delphinus
Copy link
Contributor

@delphinus delphinus commented Oct 24, 2020

I'm not sure that this is a good way...

The current build reads .index and calculates the ID in showing each entry. This diff enables to cache all entries formerly and search them pretty fast.

This effects most significantly, it improves 49s → 10s to nb list on my box.

nb listresult
> time ./nb list > /dev/null

________________________________________________________
Executed in   49.56 secs   fish           external
   usr time   20.24 secs  149.00 micros   20.24 secs
   sys time   27.77 secs  814.00 micros   27.77 secs


> time ./nb list > /dev/null

________________________________________________________
Executed in   10.92 secs   fish           external
   usr time    6.19 secs  132.00 micros    6.19 secs
   sys time    4.91 secs  884.00 micros    4.91 secs

@delphinus
Copy link
Contributor Author

Hmm... nb needs to support bash <4.2 that has no associative arrays? Then, we should think a compatible way to work with it.

xwmx added a commit that referenced this pull request Oct 24, 2020
xwmx added a commit that referenced this pull request Oct 24, 2020
xwmx added a commit that referenced this pull request Oct 25, 2020
refs gh-57

* master:
  Avoid unbound variable errors on macOS.
  Improve formatting in _list().
  Improve spacing in `list`.
  Improve variable names in `list`.
  Improve alignment.
  Remove unneeded assignment in `count`.
  Count items scoped with options in `list`.
  Improve selection limit behavior in `list`.
  Update filename counting in `list` for streaming.
  Include additional test for `list` ids.
  Improve logic for displaying "omitted" in _list().
  Stream data through _list()
xwmx added a commit that referenced this pull request Oct 25, 2020
refs gh-57

* master:
  Update version to 5.7.8
  Improve variable name in _add().
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

Successfully merging this pull request may close these issues.

1 participant