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

Really slow startup time! #7217

Closed
abhi18av opened this issue Sep 29, 2016 · 16 comments
Closed

Really slow startup time! #7217

abhi18av opened this issue Sep 29, 2016 · 16 comments

Comments

@abhi18av
Copy link

abhi18av commented Sep 29, 2016

Hii spacemacs team ;)

Description

My spacemacs is slow, like really slow. It takes about 16 seconds to load!

I have about 370 packages installed and on mac retina pro

  • it takes about 16 seconds to start
  • the general processing of tasks is really slow

I know that the config is not that big an issue since the same config works on my ubuntu i5 machine

  • it takes about 4 seconds to start
  • general processing is definitely comparable to Sublime Text 3!

I have a hunch that it's a GUI problem since on Terminal it takes about 6 seconds but is quite fast otherwise.

On ubuntu the build config is
+

On mac the build config is

  • "GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0, NS apple-appkit-1348.17)\n of 2016-09-06 on abhinavs-MacBook-Pro.local"

I compiled this emacs with the following config

brew install emacs --with-cocoa --with-ctags --with-dbus --with-glib --with-imagemagick --with-mailutils 

I've even tested the config with emacs25.1 downloaded from emacsformacosx which, actually has a slower start time but I'm yet to test it well enough!

Reproduction guide

  • Start Emacs

Well, the startup itself is a huge part of the problem but the general responsiveness is not that good on my machine.

System Info

  • OS: darwin
  • Emacs: 24.5.1
  • Spacemacs: 0.105.21
  • Spacemacs branch: nil (rev. nil)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(mu4e auto-completion better-defaults emacs-lisp clojure git markdown org haskell html lua php java ocaml d go rust c-c   javascript latex python racket scheme sql vimscript common-lisp ipython-notebook django react xkcd emoji ruby-on-rails chrome finance search-engine speed-reading eyebrowse dash fasd pandoc ansible dockerfile chinese theming restclient prodigy gtags deft colors
      (shell :variables shell-default-height 30 shell-default-position 'bottom)
      (ruby :variables ruby-enable-enh-ruby-mode t ruby-test-runner 'rspec ruby-version-manager 'rbenv)
      spell-checking syntax-checking version-control)
@TheBB
Copy link
Collaborator

TheBB commented Sep 29, 2016

Please run with --profile and --timed-requires and report the results.

@d12frosted
Copy link
Collaborator

d12frosted commented Sep 29, 2016

Emacs 25 is known to be much faster than Emacs 24 on OS X. I switched long time ago to Emacs 25 and since then I rarely have problems with performance.

Updated

Also note that emacs and emacs-plus brew formulas now install Emacs 25.

@abhi18av
Copy link
Author

abhi18av commented Sep 29, 2016

@TheBB , so here's the output of

emacs --profile

  • Memory-Profiler-Report
+ normal-top-level                                      3,878,250,849  91%
+ timer-event-handler                                     360,102,723   8%
+ redisplay_internal (C function)                             160,824   0%
+ flyspell-post-command-hook                                  131,072   0%
+ ...                                                          46,734   0%
+ tooltip-show-help-non-mode                                   20,540   0%
  mouse-fixup-help-message                                      1,024   0%

emacs --profile

  • CPU-Profiler-Report
+ normal-top-level                                               5846  78%
+ timer-event-handler                                             909  12%
+ ...                                                             662   8%
+ redisplay_internal (C function)                                   4   0%
  tooltip-show-help-non-mode                                        2   0%
  flyspell-post-command-hook                                        1   0%

emacs --timed-requires

Threshold set at 0.150 seconds

File /Users/eklavya/.emacs.d/layers/+distribution/spacemacs/config.el: Loaded /Users/eklavya/.emacs.d/layers/+distribution/spacemacs-base/config.el: 0.163 sec
File /Users/eklavya/.emacs.d/init.el: Loaded /Users/eklavya/.emacs.d/layers/+distribution/spacemacs/config.el: 0.219 sec
File /Users/eklavya/.emacs.d/elpa/git-gutter+-20151204.923/git-gutter+.elc: Required tramp: 0.694 sec
File /Users/eklavya/.emacs.d/elpa/php-extras-20160518.2046/php-extras.elc: Required eldoc: 0.191 sec
File /Users/eklavya/.emacs.d/init.el: Loaded /Users/eklavya/.emacs.d/elpa/php-extras-20160518.2046/php-extras-autoloads: 0.194 sec
File /Users/eklavya/.emacs.d/elpa/eclim-20160901.16/eclim-completion.elc: Required yasnippet: 0.716 sec
File /Users/eklavya/.emacs.d/elpa/company-emacs-eclim-20160813.1754/company-emacs-eclim.elc: Required eclim-completion: 0.727 sec
File nil: Required company-emacs-eclim: 0.737 sec
File /Users/eklavya/.emacs.d/elpa/request-deferred-20160419.1605/request-deferred.elc: Required request: 0.224 sec
File /Users/eklavya/.emacs.d/elpa/org-wunderlist-20150817.1913/org-wunderlist.elc: Required request-deferred: 0.242 sec
File /Users/eklavya/.emacs.d/elpa/org-20160926/org-element.elc: Required org: 0.573 sec
File /Users/eklavya/.emacs.d/elpa/org-wunderlist-20150817.1913/org-wunderlist.elc: Required org-element: 0.592 sec
File /Users/eklavya/.emacs.d/private/local/secrets.el: Required org-wunderlist: 1.137 sec
File nil: Loaded ~/.emacs.d/private/local/secrets.el: 1.139 sec
File /usr/local/Cellar/emacs/24.5/share/emacs/24.5/lisp/eshell/eshell.elc: Required esh-mode: 0.242 sec
File /Users/eklavya/.emacs.d/elpa/projectile-20160926.1133/projectile.elc: Required eshell: 0.270 sec
File /Users/eklavya/.emacs.d/elpa/helm-20160926.1203/helm-files.elc: Required helm-bookmark: 0.176 sec
File /Users/eklavya/.emacs.d/elpa/helm-20160926.1203/helm-mode.elc: Required helm-files: 0.573 sec
File nil: Required helm: 0.700 sec

Hey, I notice that I got this warning on the terminal

Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!

Is this related anyhow?

@abhi18av
Copy link
Author

abhi18av commented Sep 29, 2016

@d12frosted actually, I too am looking forward to features like xwidget etc but I quite wary of messing up what-works right now, I'm somewhere near being a noob at things so I'd compile it after

  • I've learned enough about about emacs itself
  • when there are tutorials/blog-posts available on compiling with my-desired-features for mac

If you could please, then please post the commands you used to compile your copy, I'd really appreciate it )

@robbyoconnor
Copy link
Contributor

Run with emacs 25 -- it's much better. I've been using it -- no issues whatsoever. I think we should support Emacs 25.

@d12frosted
Copy link
Collaborator

@abhi18av Emacs 25 is not about xwidgets. It's just with Emacs 25 you can build emacs with xwidgets support directly from master. But it's not built with xwidgets support by default and you can't build with xwidgets support using emacs or emacs-plus brew formulas.

So in short - Emacs 25 is just new version and it's highly advised to use it instead of Emacs 24.

In order to install Emacs 25 you don't need to pass any extra options. Just do brew update and reinstall emacs. Probably even plain old upgrade might work.

But there are installation instructions for you 😸


@robbyoconnor

I think we should support Emacs 25.

We support it, don't we? 😸

@abhi18av
Copy link
Author

abhi18av commented Sep 30, 2016

@robbyoconnor and @d12frosted , okay I'll give it a build tonight. But, regarding the slow startup time - the problem pretty much persists even if I switch doesn't it?

@d12frosted
Copy link
Collaborator

Startup time might be faster. Depending on what's slowing it. I am not a big person when it comes to Emacs profiling.

@abhi18av
Copy link
Author

@d12frosted , @TheBB Hey guys, so I upgraded everything and just added the --with-module option as an extra. Though things feel a bit smoother and more responsive after the startup but the startup time has only increased further.

Now emacs25.1 takes about 18.921 seconds to start!

Really, in need of some magic word :)

@dangom
Copy link
Contributor

dangom commented Oct 1, 2016

@abhi18av , my emacs is also slow to startup on a retina pro. It's always been like that - even before I switched to Spacemacs.

Your problem has nothing to do with Emacs nor Spacemacs. It has to do with the obscene amount of packages that you are loading (370).
Do you really need all of those layers? speedread, emoji, xkcd, chinese, theming?

@abhi18av
Copy link
Author

abhi18av commented Oct 1, 2016

@dangom, hehe yes I know it's a bit overboard but right now I'm, pushing the limits - I tried LightTable, Atom and Sublime none have the same freedom as Emacs and Vim:)

The packages are more like role models for my own packages.

As for, startup time I assure you stock emacs24 and emacs25 start in 2/3 second. It's a curious issue that the startup time isn't linear wrt packages!

@alanz
Copy link
Contributor

alanz commented Oct 4, 2016

I noticed that while all the elpa packages are compiled to .elc, this is not the case for any of the core. Surely automatically compiling these would speed things up? If so, how?

@punassuming
Copy link
Contributor

I am looking into this as well. With spacemacs distro, and a few packages, was getting startups of around 26 sec. Just tested out and with spacemacs-base, no user-init or user-config and no layers defined, I am still at a startup time of 6,5 seconds.

Using 25.1 on Windows.

@punassuming
Copy link
Contributor

All, I updated the debugging functionality to increase the visibility in what is delaying Spacemacs load times, in #8014

@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 6, 2017

Could checking for new packages in melpa and installing them be done on the background during startup? For me that is the most time-consuming part of starting spacemacs: some package will fail to install for a while for unknown reasons, and on every startup the package is downloaded, reinstalled, that fails, ...

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@lebensterben lebensterben removed the stale marked as a stale issue/pr (usually by a bot) label Feb 4, 2022
@lebensterben lebensterben moved this from Answered, waiting to To close in Forum Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Forum
  
To close
Development

No branches or pull requests

9 participants