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

Speeding up jenv initialization when using fish #341

Open
0az opened this issue Nov 7, 2021 · 0 comments
Open

Speeding up jenv initialization when using fish #341

0az opened this issue Nov 7, 2021 · 0 comments

Comments

@0az
Copy link
Contributor

0az commented Nov 7, 2021

Right now, new interactive shells take approximately ~600ms to start in fish. Profiling shows that jenv's init process accounts for approximately 75% (~450ms) of that time, which is further broken down into

  • jenv init - itself: ~150ms
  • Completions: ~75ms
  • jenv commands: ~75 ms
  • jenv rehash: ~100ms
  • jenv refresh-plugins: ~125ms

There's two optimizations that might help:

  1. Replacing source ($command | psub) with $command | source. This avoids the psub temporary file overhead, and is possibly statistically significant outside of microbenchmarks.
  2. Lazily calling jenv rehash and jenv refresh-plugins. Do these really need to run on every interactive shell invocation? Is restricting them to login shells only fine? The former's probably fine to drop, as I don't expect that the average user will need rehashes more than once per month or so, which is supported by adoptopenjdk Homebrew Cask's commit history. This isn't perfect, but it's a good estimate for how often people will notice: not very often.
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

No branches or pull requests

1 participant