emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using an org based init file slows down emacs startup by 50x..help needed :(
@ 2016-12-10  8:36 Xebar Saram
  2016-12-10  8:43 ` Nicolas Goaziou
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Xebar Saram @ 2016-12-10  8:36 UTC (permalink / raw)
  To: org mode

[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]

Hi all

So after a few months of frustration today i discovered the issue that's
been bothering me for a long time..the REALLY slow emacs startup (sometimes
5 minutes or more).

The cause is the org mode init file i use. what i currently have in my
setup is

A. this init.el:

(require 'package)
;since we are using use-package-don't autoload anythings
(setq package-enable-at-startup nil)

(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("marmalade" . "
https://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
;; org maybe suspect of hanging melpa, if you have hangs disable this first
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
;; Initialize installed package
(package-initialize)

;; Bootstrap `use-package'
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))

(org-babel-load-file (expand-file-name "~/.emacs.d/settings.org"))


B. My config stored in settings.org which alot  of lisp code (like 17,000
lines..yeah i like to tinker :))

Using this method i discovered that every time i make a small change to
setting.org and restart emacs the setting.org gets tangled to settings.el
and emacs takes nearly 5!!! minutes to start..yeah thats painful as you can
imagine.

BUT what i discovered today is that if i just stick my config chunks from
setting.org (ie the tangled setting.el file) into init.el, emacs starts
super fast each time, even when i change the init.el file!

can anyone help me with this, i really would appreciate you guys help with
this as its driving me mad :)

thx alot in advance

Z

[-- Attachment #2: Type: text/html, Size: 2835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using an org based init file slows down emacs startup by 50x..help needed :(
  2016-12-10  8:36 Using an org based init file slows down emacs startup by 50x..help needed :( Xebar Saram
@ 2016-12-10  8:43 ` Nicolas Goaziou
  2016-12-10 12:53 ` Xebar Saram
  2016-12-12 21:30 ` Grant Rettke
  2 siblings, 0 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2016-12-10  8:43 UTC (permalink / raw)
  To: Xebar Saram; +Cc: org mode

Hello,

Xebar Saram <zeltakc@gmail.com> writes:

> can anyone help me with this, i really would appreciate you guys help with
> this as its driving me mad :)

Please provide a profiler report (see `profiler-start') and possibly
instrument Org using `elp-instrument-package' so that we know what part
is the most time consuming.

Note that tangling is a somewhat slow process. You could try to diminish
the number of blocks involved or maybe try spreading them among
different sections.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using an org based init file slows down emacs startup by 50x..help needed :(
  2016-12-10  8:36 Using an org based init file slows down emacs startup by 50x..help needed :( Xebar Saram
  2016-12-10  8:43 ` Nicolas Goaziou
@ 2016-12-10 12:53 ` Xebar Saram
  2016-12-10 18:33   ` Xebar Saram
  2016-12-12 21:30 ` Grant Rettke
  2 siblings, 1 reply; 9+ messages in thread
From: Xebar Saram @ 2016-12-10 12:53 UTC (permalink / raw)
  To: org mode


[-- Attachment #1.1: Type: text/plain, Size: 327 bytes --]

Ok some more exploring made me realize that also using `M-x
org-babel-load-file` on the setting.org file and tangling it takes a LONG
time (like 6-7 minutes) so its not a problem of the init its the actual
tangling of the file. 6-7 minutes cant be normal right?

im attaching my settings.org file

would appreciate any help

Z

[-- Attachment #1.2: Type: text/html, Size: 498 bytes --]

[-- Attachment #2: settings.org --]
[-- Type: application/octet-stream, Size: 540504 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using an org based init file slows down emacs startup by 50x..help needed :(
  2016-12-10 12:53 ` Xebar Saram
@ 2016-12-10 18:33   ` Xebar Saram
  2016-12-10 20:24     ` Thomas S. Dye
  2016-12-12 10:03     ` Rainer M Krug
  0 siblings, 2 replies; 9+ messages in thread
From: Xebar Saram @ 2016-12-10 18:33 UTC (permalink / raw)
  To: org mode

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Ok so i think the reason really is that i have way to many lisp code blocks
as suggested. i found out a very interesting post that maybe of interest to
alot of org users

http://www.holgerschurig.de/en/emacs-efficiently-untangling-elisp/

this creates a new function that very efficiently tangles my org file and
the time goes from 6 minutes to 25 seconds!!

this is a link to an example init file

https://bitbucket.org/holgerschurig/emacsconf/src/416b2bba2d1d334b9c6ddbd56f8c7f8bd8bc4aab?at=master

i really think this should go somewhere in the org documentation

best to all

Z

On Sat, Dec 10, 2016 at 2:53 PM, Xebar Saram <zeltakc@gmail.com> wrote:

> Ok some more exploring made me realize that also using `M-x
> org-babel-load-file` on the setting.org file and tangling it takes a LONG
> time (like 6-7 minutes) so its not a problem of the init its the actual
> tangling of the file. 6-7 minutes cant be normal right?
>
> im attaching my settings.org file
>
> would appreciate any help
>
> Z
>
>

[-- Attachment #2: Type: text/html, Size: 1852 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using an org based init file slows down emacs startup by 50x..help needed :(
  2016-12-10 18:33   ` Xebar Saram
@ 2016-12-10 20:24     ` Thomas S. Dye
  2016-12-12 12:24       ` Julian M. Burgos
  2016-12-12 10:03     ` Rainer M Krug
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas S. Dye @ 2016-12-10 20:24 UTC (permalink / raw)
  To: Xebar Saram; +Cc: org mode

Aloha Xebar,

Xebar Saram writes:

> Ok so i think the reason really is that i have way to many lisp code blocks
> as suggested. i found out a very interesting post that maybe of interest to
> alot of org users
>
> http://www.holgerschurig.de/en/emacs-efficiently-untangling-elisp/
>
> this creates a new function that very efficiently tangles my org file and
> the time goes from 6 minutes to 25 seconds!!
>
> this is a link to an example init file
>
> https://bitbucket.org/holgerschurig/emacsconf/src/416b2bba2d1d334b9c6ddbd56f8c7f8bd8bc4aab?at=master

Have you seen Eric Schulte's starter-kit
(http://eschulte.github.io/emacs24-starter-kit/)?  Using it, I keep my
initialization functions in a few different Org mode files, which the
starter-kit tangles to .el iff the Org mode file has been changed since
it was last tangled.  I'm able to keep the initialization process
reasonably organized (I'm the limiting factor), without the wait.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using an org based init file slows down emacs startup by 50x..help needed :(
  2016-12-10 18:33   ` Xebar Saram
  2016-12-10 20:24     ` Thomas S. Dye
@ 2016-12-12 10:03     ` Rainer M Krug
  1 sibling, 0 replies; 9+ messages in thread
From: Rainer M Krug @ 2016-12-12 10:03 UTC (permalink / raw)
  To: Xebar Saram; +Cc: org mode

[-- Attachment #1: Type: text/plain, Size: 1423 bytes --]

Xebar Saram <zeltakc@gmail.com> writes:

> Ok so i think the reason really is that i have way to many lisp code blocks as suggested. i found out a very interesting post that maybe of interest to alot of
> org users

Well - it took on my MacBook Pro Retina about 30 seconds -

,----
| Wrote /Users/rainerkrug/tmp/settings.el [745 times]
| Tangled 745 code blocks from settings.org
`----

so I guess something else is fishy in your setup

Rainer


>
> http://www.holgerschurig.de/en/emacs-efficiently-untangling-elisp/
>
> this creates a new function that very efficiently tangles my org file and the time goes from 6 minutes to 25 seconds!!
>
> this is a link to an example init file
>
> https://bitbucket.org/holgerschurig/emacsconf/src/416b2bba2d1d334b9c6ddbd56f8c7f8bd8bc4aab?at=master
>
> i really think this should go somewhere in the org documentation 
>
> best to all
>
> Z
>
> On Sat, Dec 10, 2016 at 2:53 PM, Xebar Saram <zeltakc@gmail.com> wrote:
>
>  Ok some more exploring made me realize that also using `M-x org-babel-load-file` on the setting.org file and tangling it takes a LONG time (like 6-7
>  minutes) so its not a problem of the init its the actual tangling of the file. 6-7 minutes cant be normal right? 
>
>  im attaching my settings.org file
>
>  would appreciate any help
>
>  Z
>
>

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using an org based init file slows down emacs startup by 50x..help needed :(
  2016-12-10 20:24     ` Thomas S. Dye
@ 2016-12-12 12:24       ` Julian M. Burgos
  0 siblings, 0 replies; 9+ messages in thread
From: Julian M. Burgos @ 2016-12-12 12:24 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Xebar Saram, org mode

Hi Xebar,

An simple alternative is to do what I do: keep your init file in an org
mode file, and simple tangle it manually whenever you do changes.  In
this way you avoid the overload of the tangling process at startup.  My
emacs starts in about 10 seconds.

Julian

Thomas S. Dye writes:

> Aloha Xebar,
>
> Xebar Saram writes:
>
>> Ok so i think the reason really is that i have way to many lisp code blocks
>> as suggested. i found out a very interesting post that maybe of interest to
>> alot of org users
>>
>> http://www.holgerschurig.de/en/emacs-efficiently-untangling-elisp/
>>
>> this creates a new function that very efficiently tangles my org file and
>> the time goes from 6 minutes to 25 seconds!!
>>
>> this is a link to an example init file
>>
>> https://bitbucket.org/holgerschurig/emacsconf/src/416b2bba2d1d334b9c6ddbd56f8c7f8bd8bc4aab?at=master
>
> Have you seen Eric Schulte's starter-kit
> (http://eschulte.github.io/emacs24-starter-kit/)?  Using it, I keep my
> initialization functions in a few different Org mode files, which the
> starter-kit tangles to .el iff the Org mode file has been changed since
> it was last tangled.  I'm able to keep the initialization process
> reasonably organized (I'm the limiting factor), without the wait.
>
> hth,
> Tom


--
Julian Mariano Burgos, PhD
Hafrannsóknastofnun, rannsókna- og ráðgjafarstofnun hafs og vatna/
Marine and Freshwater Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian.burgos@hafogvatn.is

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using an org based init file slows down emacs startup by 50x..help needed :(
  2016-12-10  8:36 Using an org based init file slows down emacs startup by 50x..help needed :( Xebar Saram
  2016-12-10  8:43 ` Nicolas Goaziou
  2016-12-10 12:53 ` Xebar Saram
@ 2016-12-12 21:30 ` Grant Rettke
  2016-12-13  7:19   ` Xebar Saram
  2 siblings, 1 reply; 9+ messages in thread
From: Grant Rettke @ 2016-12-12 21:30 UTC (permalink / raw)
  To: Xebar Saram; +Cc: org mode

On Sat, Dec 10, 2016 at 2:36 AM, Xebar Saram <zeltakc@gmail.com> wrote:
> So after a few months of frustration today i discovered the issue that's
> been bothering me for a long time..the REALLY slow emacs startup

I tangled it on my box like this:

Start Emacs default

emacs --no-init-file

(emacs-version)

"GNU Emacs 24.5.1 (x86_64-apple-darwin15.4.0, NS apple-appkit-1404.46)
 of 2016-06-08 on vela"

(org-version)

"8.2.10"

In Emacs I evaluated

(defmacro measure-time (&rest body)
  "Measure the time it takes to evaluate BODY."
  `(let ((time (current-time)))
     ,@body
     (message "%.06f" (float-time (time-since time)))))

And timed and tangled it.

It took approximately 8 minutes.

When I tangle it using my config it takes approximately 11 seconds.

I would start with a bisection of the file to try and narrow down when
and where the slowdown occurs.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Using an org based init file slows down emacs startup by 50x..help needed :(
  2016-12-12 21:30 ` Grant Rettke
@ 2016-12-13  7:19   ` Xebar Saram
  0 siblings, 0 replies; 9+ messages in thread
From: Xebar Saram @ 2016-12-13  7:19 UTC (permalink / raw)
  To: Grant Rettke; +Cc: org mode

[-- Attachment #1: Type: text/plain, Size: 1370 bytes --]

thx all

Grant, thats interesting since i did start with the bisecting method and
couldnt identify the culprit.

again using the method here

https://bitbucket.org/holgerschurig/emacsconf/src/416b2bba2d1d334b9c6ddbd56f8c7f8bd8bc4aab?at=master

works SUPER fast (~10 seconds) so for now ill stick with it until i find
the culprit

very strange though

best

Z

On Mon, Dec 12, 2016 at 11:30 PM, Grant Rettke <gcr@wisdomandwonder.com>
wrote:

> On Sat, Dec 10, 2016 at 2:36 AM, Xebar Saram <zeltakc@gmail.com> wrote:
> > So after a few months of frustration today i discovered the issue that's
> > been bothering me for a long time..the REALLY slow emacs startup
>
> I tangled it on my box like this:
>
> Start Emacs default
>
> emacs --no-init-file
>
> (emacs-version)
>
> "GNU Emacs 24.5.1 (x86_64-apple-darwin15.4.0, NS apple-appkit-1404.46)
>  of 2016-06-08 on vela"
>
> (org-version)
>
> "8.2.10"
>
> In Emacs I evaluated
>
> (defmacro measure-time (&rest body)
>   "Measure the time it takes to evaluate BODY."
>   `(let ((time (current-time)))
>      ,@body
>      (message "%.06f" (float-time (time-since time)))))
>
> And timed and tangled it.
>
> It took approximately 8 minutes.
>
> When I tangle it using my config it takes approximately 11 seconds.
>
> I would start with a bisection of the file to try and narrow down when
> and where the slowdown occurs.
>

[-- Attachment #2: Type: text/html, Size: 2201 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-12-13  7:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-10  8:36 Using an org based init file slows down emacs startup by 50x..help needed :( Xebar Saram
2016-12-10  8:43 ` Nicolas Goaziou
2016-12-10 12:53 ` Xebar Saram
2016-12-10 18:33   ` Xebar Saram
2016-12-10 20:24     ` Thomas S. Dye
2016-12-12 12:24       ` Julian M. Burgos
2016-12-12 10:03     ` Rainer M Krug
2016-12-12 21:30 ` Grant Rettke
2016-12-13  7:19   ` Xebar Saram

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).