Slow Prompt Caused by Conda?

My Prompt now takes a bit longer to load in and I was wondering if conda/Anaconda could be to blame?

Here’s my ~/.bashrc file:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
    PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
        for rc in ~/.bashrc.d/*; do
                if [ -f "$rc" ]; then
                        . "$rc"
                fi
        done
fi

unset rc

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/nmcivor/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/nmcivor/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/nmcivor/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/nmcivor/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

Maybe that’s just a side effect of changing the default state to having base deactivated?
(so that I have to run conda activate base to use conda and thus jupyter notebooks)

1 Like

dear rando.

thank you for your posting.

Maybe that’s just a side effect of changing the default state to having base deactivated?

I think that’s part of it, but due to the nature of bash, the more applications there are in /usr/bin/ and /usr/local/bin, the more PATH searches will occur, so I think that’s also the cause.
In order to solve those problems, we need to think in isolation.

For example, prepare a second-hand PC that is not in use, put anaconda in, prepare a PC with the same number of applications as you are currently using in /usr/bin, and take benchmarks for each. It would be nice to see

If the slowness of the disk is the cause, I think that it can be solved by changing the HDD to SSD, increasing the amount of RAM if the swap is large. Of course, it is also a hand to make the CPU and GPU the latest ones.

Regards, you.
ktsh.tanaka.2020