ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 222 forks source link

Slow startup of new terminal sessions. #10781

Open jvhaarst opened 5 years ago

jvhaarst commented 5 years ago

Actual Behavior

Starting up a new terminal session with conda init lines present is very slow.

Expected Behavior

Startup should be quick, maybe a second slower than without init lines

Steps to Reproduce

Run conda init to add the lines.

Anaconda or Miniconda version:

conda 4.6.8

Operating System:

Linux, Ubuntu 18.04.2 LTS

conda info
``` conda info active environment : base active env location : /home/haars001/miniconda2 shell level : 1 user config file : /home/haars001/.condarc populated config files : /home/haars001/.condarc conda version : 4.6.8 conda-build version : 3.17.8 python version : 2.7.15.final.0 base environment : /home/haars001/miniconda2 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://conda.anaconda.org/bioconda/linux-64 https://conda.anaconda.org/bioconda/noarch https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch package cache : /home/haars001/miniconda2/pkgs /home/haars001/.conda/pkgs envs directories : /home/haars001/miniconda2/envs /home/haars001/.conda/envs platform : linux-64 user-agent : conda/4.6.8 requests/2.21.0 CPython/2.7.15 Linux/4.15.0-45-generic ubuntu/18.04.2 glibc/2.27 UID:GID : 16825946:16777729 netrc file : None offline mode : False ```
conda list --show-channel-urls
``` conda list --show-channel-urls # packages in environment at /home/haars001/miniconda2: # # Name Version Build Channel agate 1.6.0 py_3 conda-forge agate-dbf 0.2.1 py_0 conda-forge agate-excel 0.2.3 py_0 conda-forge agate-sql 0.5.4 py_0 conda-forge anaconda-client 1.7.2 py_0 conda-forge anaconda-nb-extensions 1.0.0 py27_0 anaconda-nb-extensions appdirs 1.4.3 py_1 conda-forge aragorn 1.2.38 h470a237_2 bioconda asn1crypto 0.24.0 py27_1003 conda-forge atk 2.25.90 hf2eb9ee_1001 conda-forge atomicwrites 1.3.0 py_0 conda-forge attrs 19.1.0 py_0 conda-forge automat 0.7.0 py_1 conda-forge babel 2.6.0 py_1 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.5 py_1 conda-forge backports.os 0.1.1 py27_1000 conda-forge backports.shutil_get_terminal_size 1.0.0 py_3 conda-forge backports_abc 0.5 py_1 conda-forge bashplotlib 0.6.5 py_0 conda-forge bcftools 1.9 ha228f0b_3 bioconda beautifulsoup4 4.7.1 py27_1001 conda-forge bedops 2.4.35 h2d50403_1 bioconda binutils_impl_linux-64 2.31.1 h6176602_1 conda-forge binutils_linux-64 2.31.1 h6176602_3 conda-forge biopython 1.73 py27h14c3975_0 conda-forge biothings_client 0.2.0 py_0 bioconda blas 2.4 openblas conda-forge blat 36 0 bioconda bleach 3.1.0 py_0 conda-forge bokeh 1.0.4 py27_1000 conda-forge boost 1.69.0 py27h8619c78_1001 conda-forge boost-cpp 1.69.0 h11c811c_1000 conda-forge bx-python 0.7.3 pypi_0 pypi bz2file 0.98 py_0 conda-forge bzip2 1.0.6 h14c3975_1002 conda-forge ca-certificates 2019.1.23 0 defaults cairo 1.14.12 h80bd089_1005 conda-forge certifi 2019.3.9 py27_0 defaults cffi 1.12.2 py27hf0e25f4_1 conda-forge chardet 3.0.4 py27_1003 conda-forge chrpath 0.16 h14c3975_1001 conda-forge cigar 0.1.3 pypi_0 pypi clang_variant 1.0 cling_6.14.06 conda-forge clangdev 5.0.0 h935a590_1004 conda-forge click 7.0 py_0 conda-forge cling 0.5 he860b03_1006 conda-forge cloudpickle 0.6.1 pypi_0 pypi clyent 1.2.2 py_1 conda-forge cni 0.6.0 h8a17f66_1002 conda-forge cni-plugins 0.7.5 hc0beb16_0 conda-forge cogent 3.9 pypi_0 pypi colormath 3.0.0 py_2 conda-forge conda 4.6.8 py27_0 defaults conda-build 3.17.8 py27_1 conda-forge conda-env 2.6.0 1 conda-forge conda-verify 3.1.1 py27_1000 conda-forge configparser 3.7.3 py27_1 conda-forge constantly 15.1.0 py_0 conda-forge contextlib2 0.5.5 py_2 conda-forge cppzmq 4.3.0 h484f380_1000 conda-forge cryptography 2.6.1 py27h1ba5d50_0 defaults cryptography-vectors 2.6.1 py_0 conda-forge cryptopp 7.0.0 hf484d3e_1003 conda-forge csvkit 1.0.3 py_1 conda-forge cupcake 5.3 pypi_0 pypi curl 7.64.0 hbc83047_2 defaults cycler 0.10.0 py_1 conda-forge dask 0.20.2 pypi_0 pypi data_hacks 0.3.1 py27_1 bioconda dbfread 2.0.7 py_0 conda-forge dbus 1.13.2 h714fa37_1 defaults decorator 4.4.0 py_0 conda-forge defusedxml 0.5.0 py_1 conda-forge entrypoints 0.3 py27_1000 conda-forge enum34 1.1.6 py27_1001 conda-forge et_xmlfile 1.0.1 py27_0 conda-forge expat 2.2.5 hf484d3e_1002 conda-forge fastool 0.1.4 ha92aebf_3 bioconda filelock 3.0.10 py_0 conda-forge fontconfig 2.13.1 he4413a7_1000 conda-forge freetype 2.10.0 he983fc9_0 conda-forge ftputil 3.4 py_0 conda-forge funcsigs 1.0.2 py_3 conda-forge functools32 3.2.3.2 py_3 conda-forge future 0.17.1 py27_1000 conda-forge futures 3.2.0 py27_1000 conda-forge gcc_impl_linux-64 7.3.0 habb00fd_1 conda-forge gcc_linux-64 7.3.0 h553295d_3 conda-forge gdk-pixbuf 2.36.12 h4f1c04b_1001 conda-forge genometools 1.2.1 py27_0 bioconda get_terminal_size 1.0.0 haa9412d_0 defaults gettext 0.19.8.1 hc5be6a0_1002 conda-forge ghost.py 0.2.3 py_1 conda-forge giflib 5.1.7 h516909a_1 conda-forge glib 2.56.2 had28632_1001 conda-forge glob2 0.6 py_0 conda-forge gmp 6.1.2 hf484d3e_1000 conda-forge gnutls 3.6.5 hd3a4fd2_1002 conda-forge gobject-introspection 1.56.1 py27h9e29830_1001 conda-forge graphite2 1.3.13 hf484d3e_1000 conda-forge graphviz 2.38.0 hcf1ce16_1009 conda-forge gsl 2.4 h294904e_1005 conda-forge gst-plugins-base 1.14.0 hbbd80ab_1 defaults gstreamer 1.14.0 hb453b48_1 defaults gtk2 2.24.31 h5baeb44_1000 conda-forge gxx_impl_linux-64 7.3.0 hdf63c60_1 conda-forge gxx_linux-64 7.3.0 h553295d_3 conda-forge h5py 2.8.0 py27h097b052_4 conda-forge harfbuzz 1.9.0 he243708_1001 conda-forge hdf5 1.10.4 nompi_h3c11f04_1106 conda-forge hmmer 3.2.1 hf484d3e_1 bioconda html5lib 1.0.1 py_0 conda-forge htseq 0.11.2 py27h637b7d7_1 bioconda htslib 1.9 ha228f0b_6 bioconda httplib2 0.12.1 py27_0 conda-forge hyperlink 17.3.1 py_0 conda-forge icu 58.2 hf484d3e_1000 conda-forge idna 2.8 py27_1000 conda-forge ijson 2.3 pypi_0 pypi importlib_metadata 0.8 py27_0 conda-forge incremental 17.5.0 py_0 conda-forge infernal 1.1.2 h14c3975_2 bioconda intel-openmp 2019.3 199 defaults intermine 1.11.0 py_0 bioconda ipaddress 1.0.22 py_1 conda-forge ipykernel 4.10.0 py27_1 conda-forge ipython 5.8.0 py27_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.4.2 py_0 conda-forge isodate 0.6.0 py_1 conda-forge java-jdk 8.0.92 1 bioconda jbig 2.1 h14c3975_2001 conda-forge jdcal 1.4 py_1 conda-forge jellyfish 0.6.1 py27h14c3975_1000 conda-forge jemalloc 5.1.0 he1b5a44_1001 conda-forge jinja2 2.10 py_1 conda-forge jpeg 9c h14c3975_1001 conda-forge jq 1.6 h14c3975_1000 conda-forge jsonschema 3.0.1 py27_0 conda-forge jupyter 1.0.0 py_1 conda-forge jupyter_client 5.2.4 py_3 conda-forge jupyter_console 5.2.0 py27_1 conda-forge jupyter_core 4.4.0 py_0 conda-forge jupyterlab 0.33.12 py27_0 conda-forge jupyterlab_launcher 0.11.2 py_0 conda-forge kiwisolver 1.0.1 py27h6bb024c_1002 conda-forge krb5 1.16.1 h173b8e3_7 defaults ldc 1.13.0 h02c9852_1 conda-forge leather 0.3.3 py_0 conda-forge libarchive 3.3.3 h5d8350f_5 defaults libblas 3.8.0 4_openblas conda-forge libboost 1.67.0 h46d08c1_4 defaults libcblas 3.8.0 4_openblas conda-forge libcurl 7.64.0 h20c2e04_2 defaults libdb 6.1.26 hf484d3e_2000 conda-forge libdeflate 1.0 h14c3975_1 bioconda libedit 3.1.20170329 hf8c457e_1001 conda-forge libffi 3.2.1 he1b5a44_1006 conda-forge libgcc 7.2.0 h69d50b8_2 conda-forge libgcc-ng 7.3.0 hdf63c60_0 conda-forge libgd 2.2.5 h0d07dcb_1005 conda-forge libgfortran 3.0.0 1 conda-forge libgfortran-ng 7.2.0 hdf63c60_3 conda-forge libgpuarray 0.7.6 h14c3975_1003 conda-forge libiconv 1.15 h516909a_1005 conda-forge libidn 7.45.0 2 bioconda libidn11 1.34 h1cef754_0 conda-forge liblapack 3.8.0 4_openblas conda-forge liblapacke 3.8.0 4_openblas conda-forge liblief 0.9.0 h1532aa0_0 conda-forge libopenblas 0.2.20 h9ac9557_7 defaults libpng 1.6.36 h84994c4_1000 conda-forge libseccomp 2.4.0 h516909a_0 conda-forge libsodium 1.0.16 h14c3975_1001 conda-forge libssh2 1.8.0 h1ba5d50_4 defaults libstdcxx-ng 7.3.0 hdf63c60_0 conda-forge libtiff 4.0.10 h648cc4a_1001 conda-forge libtool 2.4.6 h14c3975_1002 conda-forge libuuid 2.32.1 h14c3975_1000 conda-forge libwebp 1.0.2 h99fbfcb_2 conda-forge libxcb 1.13 h14c3975_1002 conda-forge libxml2 2.9.8 h143f9aa_1005 conda-forge libxslt 1.1.32 h4785a14_1002 conda-forge linecache2 1.0.0 py_1 conda-forge llvm-meta 7.0.1 0 conda-forge llvmdev 7.0.1 h6bb024c_1002 conda-forge lxml 4.3.2 py27h23eabaa_0 conda-forge lz4 2.1.6 py27ha8eefa0_1000 conda-forge lz4-c 1.8.1.2 0 conda-forge lzo 2.10 h14c3975_1000 conda-forge lzstring 1.0.3 py27_0 conda-forge make 4.2.1 h14c3975_2004 conda-forge mako 1.0.7 py_1 conda-forge markdown 2.6.11 py_0 conda-forge markupsafe 1.1.1 py27h14c3975_0 conda-forge matplotlib 2.2.3 py27h8a2030e_1 conda-forge matplotlib-base 2.2.3 py27h60b886d_1 conda-forge matplotlib-venn 0.11.5 py_1 conda-forge minced 0.3.2 0 bioconda minimap2 2.16 h84994c4_1 bioconda mistune 0.8.4 py27h14c3975_1000 conda-forge mkl 2019.3 199 defaults mkl_fft 1.0.10 py27_0 conda-forge mkl_random 1.0.2 py27_0 conda-forge mmtf-python 1.1.2 py_0 conda-forge more-itertools 4.3.0 py27_1000 conda-forge mpi 1.0 openmpi conda-forge msgpack-python 0.6.1 py27h6bb024c_0 conda-forge multiqc 1.3.dev0 pypi_0 pypi mygene 3.1.0 py_0 bioconda mysql-connector-c 6.1.11 h597af5e_0 defaults nb_anacondacloud 1.4.0 py27_0 conda-forge nb_conda 2.2.1 py27_2 conda-forge nb_conda_kernels 2.2.1 py27_0 conda-forge nbbrowserpdf 0.2.0 py27_0 conda-forge nbconvert 5.4.1 py_2 conda-forge nbformat 4.4.0 py_1 conda-forge nbpresent 3.0.2 py27_1 conda-forge ncurses 6.1 hf484d3e_1002 conda-forge nettle 3.4.1 h1bed415_1002 conda-forge networkx 1.10 pypi_0 pypi ngmlr 0.2.7 he860b03_1 bioconda nlohmann_json 3.6.1 he1b5a44_0 conda-forge nlopt 2.5.0 py27h35deaed_1000 conda-forge nose 1.3.7 py27_1002 conda-forge notebook 5.7.6 py27_0 conda-forge numpy 1.16.2 py27h8b7e671_1 conda-forge numpy-base 1.14.3 py27h2b20989_0 defaults olefile 0.46 py_0 conda-forge oniguruma 6.9.1 h14c3975_1 conda-forge openblas 0.3.5 h9ac9557_1001 conda-forge openjdk 11.0.1 h516909a_1015 conda-forge openmpi 3.1.3 h1c2f66e_1001 conda-forge openpyxl 2.6.1 py_0 conda-forge openssl 1.1.1b h7b6447c_1 defaults packaging 19.0 py_0 conda-forge pandas 0.24.2 py27hf484d3e_0 conda-forge pandoc 2.7.1 0 conda-forge pandocfilters 1.4.2 py_1 conda-forge pango 1.40.14 hf0c64fd_1003 conda-forge parafly r2013_01_21 1 bioconda parsedatetime 2.4 py_1 conda-forge patchelf 0.9 hf484d3e_1004 conda-forge path.py 11.5.0 py_0 conda-forge pathlib2 2.3.3 py27_1000 conda-forge patsy 0.5.1 py_0 conda-forge pcre 8.43 he6710b0_0 defaults peakutils 1.3.2 py_0 conda-forge perl 5.26.2 h14c3975_1002 conda-forge perl-archive-tar 2.32 pl526_0 bioconda perl-carp 1.38 pl526_2 bioconda perl-compress-raw-bzip2 2.084 pl526hfc679d8_0 bioconda perl-compress-raw-zlib 2.084 pl526h2d50403_0 bioconda perl-data-dumper 2.173 pl526_0 bioconda perl-encode 2.88 pl526_1 bioconda perl-exporter 5.72 pl526_1 bioconda perl-exporter-tiny 1.002001 pl526_0 bioconda perl-extutils-makemaker 7.34 pl526_3 bioconda perl-io-compress 2.084 pl526hfc679d8_0 bioconda perl-io-zlib 1.10 pl526_2 bioconda perl-list-moreutils 0.428 pl526_1 bioconda perl-list-moreutils-xs 0.428 pl526_0 bioconda perl-parent 0.236 pl526_1 bioconda perl-pathtools 3.73 h470a237_2 bioconda perl-scalar-list-utils 1.45 pl526h470a237_3 bioconda perl-test-more 1.001002 pl526_1 bioconda perl-xsloader 0.24 pl526_0 bioconda pexpect 4.6.0 py27_1000 conda-forge picard 2.18.29 0 bioconda pickleshare 0.7.5 py27_1000 conda-forge pigz 2.3.4 0 conda-forge pillow 5.4.1 py27h00a061d_1000 conda-forge pip 19.0.3 py27_0 conda-forge pixman 0.34.0 h14c3975_1003 conda-forge pkginfo 1.5.0.1 py_0 conda-forge pluggy 0.9.0 py_0 conda-forge poretools 0.6.1a1 py27_4 bioconda prodigal 2.6.3 1 bioconda progressbar2 3.38.0 py_1 conda-forge prometheus_client 0.6.0 py_0 conda-forge prompt_toolkit 1.0.15 py_1 conda-forge psutil 5.6.1 py27h14c3975_0 conda-forge pthread-stubs 0.4 h14c3975_1001 conda-forge ptyprocess 0.6.0 py27_1000 conda-forge pulp 1.6.9 pypi_0 pypi py 1.8.0 py_0 conda-forge py-boost 1.67.0 py27h04863e7_4 defaults py-lief 0.9.0 py27hf484d3e_0 conda-forge pyasn1 0.4.4 py_1 conda-forge pyasn1-modules 0.2.4 py_0 conda-forge pycairo 1.18.0 py27h1b9232e_1000 conda-forge pycosat 0.6.3 py27h14c3975_1001 conda-forge pycparser 2.19 py27_1 conda-forge pycrypto 2.6.1 py27h14c3975_1002 conda-forge pygments 2.3.1 py_0 conda-forge pygpu 0.7.6 py27h3010b51_1000 conda-forge pyhamcrest 1.9.0 py_2 conda-forge pyopenssl 19.0.0 py27_0 conda-forge pyparsing 2.3.1 py_0 conda-forge pypdf2 1.26.0 py_2 conda-forge pyqt 5.6.0 py27h13b7fb3_1008 conda-forge pyrsistent 0.14.11 py27h14c3975_0 conda-forge pysam 0.15.2 py27hb06f55c_2 bioconda pysocks 1.6.8 py27_1002 conda-forge pytest 4.3.1 py27_0 conda-forge pytest-runner 4.4 py_0 conda-forge python 2.7.15 h9bab390_6 defaults python-dateutil 2.8.0 py_0 conda-forge python-levenshtein 0.12.0 py27h14c3975_1000 conda-forge python-libarchive-c 2.8 py27_1004 conda-forge python-slugify 3.0.0 py_0 conda-forge python-utils 2.3.0 py_1 conda-forge pytimeparse 1.1.8 py_0 conda-forge pytz 2018.9 py_0 conda-forge pywavelets 1.0.1 pypi_0 pypi pyyaml 5.1 py27h14c3975_0 conda-forge pyzmq 18.0.1 py27h0e1adb2_0 conda-forge qt 5.6.3 h8bf5577_3 defaults qtconsole 4.4.3 py_0 conda-forge racon 1.3.2 he941832_0 bioconda readline 7.0 hf8c457e_1001 conda-forge reportlab 3.5.13 py27hbd3ef63_1000 conda-forge requests 2.21.0 py27_1000 conda-forge ruamel_yaml 0.15.71 py27h14c3975_1000 conda-forge ruby 2.5.1 h7fb2391_0 defaults sambamba 0.6.8 h89e63da_2 bioconda samtools 1.9 h8571acd_11 bioconda scandir 1.10.0 py27h14c3975_0 conda-forge scikit-image 0.14.1 pypi_0 pypi scipy 1.2.1 py27h09a28d5_1 conda-forge screed 1.0 py_1 bioconda seaborn 0.9.0 py_0 conda-forge send2trash 1.5.0 py_0 conda-forge seqtk 1.3 h84994c4_1 bioconda service_identity 17.0.0 py_0 conda-forge setuptools 40.8.0 py27_0 conda-forge simplegeneric 0.8.1 py_1 conda-forge simplejson 3.16.1 py27h470a237_0 conda-forge singledispatch 3.4.0.3 py27_1000 conda-forge sip 4.18.1 py27hf484d3e_1000 conda-forge six 1.12.0 py27_1000 conda-forge slclust 02022010 2 bioconda soupsieve 1.8 py27_0 conda-forge spectra 0.0.11 py_0 conda-forge sqlalchemy 1.3.1 py27h14c3975_0 conda-forge sqlite 3.26.0 h67949de_1001 conda-forge squashfs-tools 4.3 h06605a2_1000 conda-forge ssl_match_hostname 3.7.0.1 py_1000 conda-forge statsmodels 0.9.0 py27h3010b51_1000 conda-forge subprocess32 3.5.3 py27h14c3975_0 conda-forge swig 3.0.12 hf484d3e_1003 conda-forge tbb 2019.5 hc9558a2_0 conda-forge tbl2asn 25.6 3 bioconda terminado 0.8.1 py27_1001 conda-forge testpath 0.4.2 py_1001 conda-forge theano 1.0.4 py27hf484d3e_1000 conda-forge tidyp 1.04 1 bioconda tk 8.6.9 h84994c4_1000 conda-forge toolchain 2.4.0 0 conda-forge toolchain_c_linux-64 2.4.0 0 conda-forge toolchain_cxx_linux-64 2.4.0 0 conda-forge toolz 0.9.0 pypi_0 pypi tornado 5.1.1 py27h14c3975_1000 conda-forge tqdm 4.31.1 py_0 conda-forge traceback2 1.4.0 py27_0 conda-forge traitlets 4.3.2 py27_1000 conda-forge twisted 18.9.0 py27h14c3975_1000 conda-forge ujson 1.35 py27h14c3975_1001 conda-forge unicodecsv 0.14.1 py_1 conda-forge unidecode 1.0.23 py_0 conda-forge unittest2 1.1.0 py_0 conda-forge urllib3 1.24.1 py27_1000 conda-forge util-linux 2.21 0 defaults wcwidth 0.1.7 py_1 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.33.1 py27_0 conda-forge widgetsnbextension 3.4.2 py27_1000 conda-forge xlrd 1.2.0 py_0 conda-forge xlsxwriter 1.1.5 py_0 conda-forge xmltodict 0.12.0 py_0 conda-forge xopen 0.5.0 py_0 bioconda xorg-kbproto 1.0.7 h14c3975_1002 conda-forge xorg-libice 1.0.9 h516909a_1004 conda-forge xorg-libsm 1.2.3 h84519dc_1000 conda-forge xorg-libx11 1.6.7 h14c3975_1000 conda-forge xorg-libxau 1.0.9 h14c3975_0 conda-forge xorg-libxdmcp 1.1.3 h516909a_0 conda-forge xorg-libxext 1.3.4 h516909a_0 conda-forge xorg-libxpm 3.5.12 h14c3975_1002 conda-forge xorg-libxrender 0.9.10 h516909a_1002 conda-forge xorg-libxt 1.1.5 h14c3975_1002 conda-forge xorg-renderproto 0.11.1 h14c3975_1002 conda-forge xorg-xextproto 7.3.0 h14c3975_1002 conda-forge xorg-xproto 7.0.31 h14c3975_1007 conda-forge xtl 0.6.1 hc9558a2_0 conda-forge xz 5.2.4 h14c3975_1001 conda-forge yajl 2.1.0 0 conda-forge yaml 0.1.7 h14c3975_1001 conda-forge zeromq 4.2.5 hf484d3e_1006 conda-forge zipp 0.3.3 py_0 conda-forge zlib 1.2.11 h14c3975_1004 conda-forge zope.interface 4.6.0 py27h14c3975_1000 conda-forge zstd 1.3.7 h0b5b093_0 defaults ```
jvhaarst commented 5 years ago

I know this was already mentioned in https://github.com/ContinuumIO/anaconda-issues/issues/10173 But that one is closed, and the problem is still there.

My init lines look like this :

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

If I remove them :

time source ~/.bashrc

real    0m0.720s
user    0m0.100s
sys     0m0.114s

If I include them :

time source ~/.bashrc

real    0m21.709s
user    0m1.378s
sys     0m2.813s

The culprit seems to be the '/home/haars001/miniconda2/bin/conda' 'shell.bash' 'hook' and eval parts, as running those separately gives:

time __conda_setup="$('/home/haars001/miniconda2/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"

real    0m6.986s
user    0m0.192s
sys     0m0.736s

and

time eval "$__conda_setup"

real    0m14.758s
user    0m0.980s
sys     0m2.161s
jvhaarst commented 5 years ago

Here are the output trace files that I created like this :

strace -r -s 80 '/home/haars001/miniconda2/bin/conda' 'shell.bash' 'hook' |& tee hookcreate.trace.txt
/home/haars001/miniconda2/bin/conda 'shell.bash' 'hook' > hook.bash
strace -r -s 80 bash hook.bash |& tee hook.trace.txt

hookcreate.trace.txt hook.trace.txt

If you need more info to track this down, please let me know.

msarahan commented 5 years ago

It looks like you might be using pip_interop_enabled. I'm guessing this because your traces show a lot of interaction with .egg stuff. If not, the next place I'd look is the <install prefix>/etc/conda/activate.d folder. These are shell scripts that get sourced to set env vars. One or more of these may be your slow-down. Your environment is massive, so there may be many of these. If you track it back to a particular package, please pay attention to which channel you obtained that package from. You'll need to file issues on the repository where your package came from, not on this repository (unless the troublesome package comes from the defaults channel). We can't support things that other people provide.

jvhaarst commented 5 years ago

I have done a massive cleanup of my base environment, and that removed a lot of stuff from the trace, but it didn't solve it. (and conda got updated to 4.6.9)

conda list --show-channel-urls

``` # packages in environment at /home/haars001/miniconda2: # # Name Version Build Channel asn1crypto 0.24.0 py27_1003 conda-forge ca-certificates 2019.1.23 0 defaults certifi 2019.3.9 py27_0 defaults cffi 1.12.2 py27hf0e25f4_1 conda-forge chardet 3.0.4 py27_1003 conda-forge conda 4.6.9 py27_0 defaults conda-env 2.6.0 1 conda-forge cryptography 2.6.1 py27h1ba5d50_0 defaults enum34 1.1.6 py27_1001 conda-forge futures 3.2.0 py27_1000 conda-forge idna 2.8 py27_1000 conda-forge ipaddress 1.0.22 py_1 conda-forge libedit 3.1.20170329 hf8c457e_1001 conda-forge libffi 3.2.1 he1b5a44_1006 conda-forge libgcc-ng 7.3.0 hdf63c60_0 conda-forge libstdcxx-ng 7.3.0 hdf63c60_0 conda-forge ncurses 6.1 hf484d3e_1002 conda-forge networkx 1.11 pypi_0 pypi openssl 1.1.1b h7b6447c_1 defaults pip 19.0.3 py27_0 conda-forge pycosat 0.6.3 py27h14c3975_1001 conda-forge pycparser 2.19 py27_1 conda-forge pyopenssl 19.0.0 py27_0 conda-forge pysocks 1.6.8 py27_1002 conda-forge python 2.7.15 h9bab390_6 defaults readline 7.0 hf8c457e_1001 conda-forge requests 2.21.0 py27_1000 conda-forge ruamel_yaml 0.15.71 py27h14c3975_1000 conda-forge setuptools 40.8.0 py27_0 conda-forge six 1.12.0 py27_1000 conda-forge sqlite 3.26.0 h67949de_1001 conda-forge tk 8.6.9 h84994c4_1000 conda-forge urllib3 1.24.1 py27_1000 conda-forge wheel 0.33.1 py27_0 conda-forge yaml 0.1.7 h14c3975_1001 conda-forge zlib 1.2.11 h14c3975_1004 conda-forge ```

Create traces:

strace -r -s 200 '/home/haars001/miniconda2/bin/conda' 'shell.bash' 'hook' 2> hookcreate.trace.txt 1>hook.bash
strace -r -s 200 bash hook.bash 2> hook.trace.txt

Check traces for slow parts :

grep -v '     0.00' hookcreate.trace.txt
     0.015880 getdents(4, /* 0 entries */, 32768) = 0
     0.059119 fstat(5, {st_mode=S_IFREG|0664, st_size=36166, ...}) = 0
     0.021839 fstat(4, {st_mode=S_IFREG|0664, st_size=7521, ...}) = 0
     0.021268 fstat(4, {st_mode=S_IFREG|0664, st_size=553, ...}) = 0
     0.012556 fstat(6, {st_mode=S_IFREG|0664, st_size=32457, ...}) = 0
     0.020299 fstat(7, {st_mode=S_IFREG|0664, st_size=7842, ...}) = 0
     0.012418 fstat(6, {st_mode=S_IFREG|0664, st_size=1310, ...}) = 0
     0.012670 fstat(5, {st_mode=S_IFREG|0664, st_size=7109, ...}) = 0
     0.127572 fstat(6, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
     0.015807 read(6, "", 4096)         = 0
     0.019757 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6626, si_uid=16825946, si_status=0, si_utime=0, si_stime=0} ---
     0.015011 openat(AT_FDCWD, "/home/haars001/miniconda2.nobackup/bin/ctypes.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)
     0.015144 fstat(6, {st_mode=S_IFREG|0664, st_size=31054, ...}) = 0
     0.017126 fstat(5, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
     0.064033 fstat(11, {st_mode=S_IFREG|0664, st_size=4370, ...}) = 0
     0.011327 fstat(10, {st_mode=S_IFREG|0664, st_size=2297, ...}) = 0
     0.011297 fstat(9, {st_mode=S_IFREG|0664, st_size=18843, ...}) = 0
     0.058932 read(11, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@ \0\0\0\0\0\0@\0\0\0\0\0\0\0\10\342\1\0\0\0\0\0\0\0\0\0@\0008\0\10\0@\0\32\0\31\0\1\0\0\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0(\34\0\0\0\0\0\0(\34\0\0\0\0\0\0\0\20\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0 \0\0\0\0\0\0\0 \0\0\0\0\0\0\0 \0\0\0\0\0\0v^\1\0\0\0\0\0v^\1\0\0\0\0\0\0\20\0\0\0\0\0\0\1\0\0\0\4\0\0\0\0\200\1\0\0\0\0\0\0\200\1\0\0\0\0\0"..., 832) = 832
     0.038842 fstat(12, {st_mode=S_IFREG|0664, st_size=6078, ...}) = 0
     0.012494 fstat(12, {st_mode=S_IFREG|0664, st_size=40959, ...}) = 0
     0.056042 fstat(5, {st_mode=S_IFREG|0664, st_size=545, ...}) = 0
     0.049760 +++ exited with 0 +++
grep -v '     0.00' hook.trace.txt
     5.578672 read(3, "ocal/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/haars001/.fzf/", 128) = 128
     0.011248 close(3)                  = 0
     0.014896 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f3734df3f20}, {sa_handler=0x5619d350e030, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f3734df3f20}, 8) = 0

So it looks like my storage is the culprit, as the only slow parts are now stats and reads...

The conda part is still very slow, though :

time source .bashrc

real    0m0.657s
user    0m0.088s
sys     0m0.117s

# enable conda init lines
time source .bashrc

real    0m12.073s
user    0m0.431s
sys     0m1.353s

hookcreate.trace.txt hook.trace.txt

msarahan commented 5 years ago

Yeah, that's still way too slow. Are you on some sort of network drive?

jvhaarst commented 5 years ago

Yeah, very slow and annoying NFS link. We are working on getting it better. Feel free to close this, as it doesn't look like something on your end.

thebirdgr commented 1 year ago

Mine was a ridiculous thing newgrp docker should not be part of the startup script. it runs in a loop