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

Performance issues with remote locations #85

Open
unode opened this issue Feb 8, 2019 · 12 comments
Open

Performance issues with remote locations #85

unode opened this issue Feb 8, 2019 · 12 comments
Labels
kind/feature A feature request; new or enhanced behavior

Comments

@unode
Copy link

unode commented Feb 8, 2019

I regularly work with remote locations mounted locally (NFS. sshfs...). These have variable latency due to network and I/O load.

After using enhancd for a few weeks and populating enhanced.log with over 3000 entries, issuing a simple cd takes between 3-5 seconds and over 10 seconds when the remote locations are under medium load. This happens even when only issuing commands that primarily target local directories.

I assume most of the delay originates from enhancd checking which directories are still reachable and slowing down when validating remote locations.
Is there any way to profile enhancd and pinpoint the source of slowness?

Contrasting this with fasd, that has been a companion for many years without major performance issues, I find 2-3 seconds a bit too much to be bearable on such an essential command.
As such is there any way to tweak enhancd to avoid hitting these performance issues?

I'm very much enjoying the interaction but the delay is ruining the experience.

@stale
Copy link

stale bot commented Feb 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 15, 2019
@unode
Copy link
Author

unode commented Feb 15, 2019

One week old and marked as stale? Quite an aggressive stale bot.

@stale stale bot removed the stale label Feb 15, 2019
@crhg
Copy link
Contributor

crhg commented Feb 16, 2019

I also encountered a similar problem. It will wait for a while until it wakes up if my home NAS is in power saving mode.

The existence check is done by __enhancd::filter::exists() function in src/filter.sh.

__enhancd::filter::exists()
{
    local line

    while read line
    do
        if [[ -d $line ]]; then
            echo "$line"
        fi
    done
}

As a workaround, I redefine this function in .zshrc after enhancd is loaded.

__enhancd::filter::exists()
{
    local line

    while read line
    do
        if [[ $line == /Volumes/* || -d $line ]]; then
            echo "$line"
        fi
    done
}

In this example, the existence check is skipped under /Volumes/.

@stale
Copy link

stale bot commented Feb 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 23, 2019
@stale
Copy link

stale bot commented Mar 9, 2019

Hi there! This has been closed due to lack of activity. Please comment if you would like it re-opened.

@stale stale bot closed this as completed Mar 9, 2019
@babarot
Copy link
Owner

babarot commented Mar 11, 2019

Sorry for late! Not staled.. I'll see this issue soon

@babarot babarot reopened this Mar 11, 2019
@stale stale bot removed the stale label Mar 11, 2019
@stale
Copy link

stale bot commented Mar 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 18, 2019
@babarot babarot added the todo label Mar 25, 2019
@stale stale bot removed the stale label Mar 25, 2019
@babarot
Copy link
Owner

babarot commented May 30, 2019

Hmm, I think we have 2 options:

  • Skip registering the path to enhancd.log
  • Skip checking existence in that case

Which one is suitable for these user experiences? Or any other alternatives?

@babarot
Copy link
Owner

babarot commented May 30, 2019

This is related to #77

@crhg
Copy link
Contributor

crhg commented May 31, 2019

I prefer this one.

  • Skip checking existence in that case

The reason is that sometimes I want to cd to a directory on a slow disk, it is useful to be able to find it in the history.

@babarot
Copy link
Owner

babarot commented Jun 3, 2019

@crhg

I prefer this one.

  • Skip checking existence in that case

The reason is that sometimes I want to cd to a directory on a slow disk, it is useful to be able to find it in the history.

Thank you for the reply!

OK, I'll follow this approach and implement based on this logic soon.

@HaleTom
Copy link
Contributor

HaleTom commented Sep 2, 2020

Cheers @crhg for the workaround.

Perhaps the solution is to provide an array:

blacklist_globs=( "/Volumes/*"  "/mnt/ssh/*" ...)

Then if line matches any of the globs, print and return.

I'm thinking regexes would be more powerful, but globs faster, and will cover most cases. Thoughts?

@babarot babarot added the kind/feature A feature request; new or enhanced behavior label Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A feature request; new or enhanced behavior
Projects
None yet
Development

No branches or pull requests

4 participants