My Sublime Text editor is running very slow, which is causing some problems when working on tasks that involve a lot of iteration.
When I run the following line in the editor:
print("Hello World")
I receive:
hello world
[Finished in 7.3s]
I am very surprised that Sublime needs 7.3 seconds to run the code. When running the same script in Atom it takes me 0.083 seconds.
This my code I have entered in my Settings. I don't think there is any connection, but I am including it just for completeness and should I maybe be overlooking something
{
"font_size": 12,
"ignored_packages":
[
"Package Control",
"Vintage"
]
}
What might be causing this slow-down and how could I speed this up?
I eventually found the cause of / solution to my problem and am going to answer my own question in case somebody else might have the same problem:
My .bash_profile file contained the following snippet of code which seemed to have been added by the Anaconda installer at some point:
# added by Anaconda3 5.3.0 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
It seems that this code was being executed every time I started my terminal and causing a waiting time of around 5-12 seconds which was quite annoying. I tried removing it and now my terminal would boot immediately. Also, Sublime now executed much faster after this change (the speed you would normally expect).
It seems that sublime boots an instance of the terminal within the editor, while atom (which was not affected by the anaconda code in .bash_profile causing the slow down) seems to be doing something different.
I was now facing the issue though that I couldnt call conda in the terminal. I was able to fix this by adding the line:
export PATH="/anaconda3/bin:$PATH"
to my .bash_profile file. This resolved the latter issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With