unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* New tool to reduce emacs start-up time on Linux
@ 2020-07-13  1:50 Blake Miller
  2020-07-13  4:21 ` Rafi Khan
  2020-07-13  5:38 ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Blake Miller @ 2020-07-13  1:50 UTC (permalink / raw)
  To: emacs-devel

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

Hello,

If you use emacs on linux, you may be interested in this tool which I just
released:

https://gitlab.com/blak3mill3r/emacs-ludicrous-speed

As the name suggests, it can provide you with the fastest emacs startup
time in the west, by using CRIU checkpoint/restore to "clone" emacsen.

It starts in ~300ms for me, and my entire (large) config is loaded eagerly.

If you try it out, I would love to hear from you.

Cheers,
Blake

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

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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13  1:50 New tool to reduce emacs start-up time on Linux Blake Miller
@ 2020-07-13  4:21 ` Rafi Khan
  2020-07-13  5:38 ` Stefan Monnier
  1 sibling, 0 replies; 10+ messages in thread
From: Rafi Khan @ 2020-07-13  4:21 UTC (permalink / raw)
  To: Blake Miller; +Cc: emacs-devel

Hi Blake,

This looks really neat! It's exciting to see work being done on
improving startup performance.

I'll take a look to see if I can get it working on my setup.

Thanks,
Rafi




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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13  1:50 New tool to reduce emacs start-up time on Linux Blake Miller
  2020-07-13  4:21 ` Rafi Khan
@ 2020-07-13  5:38 ` Stefan Monnier
  2020-07-13  8:28   ` Blake Miller
  2020-07-13 16:21   ` T.V Raman
  1 sibling, 2 replies; 10+ messages in thread
From: Stefan Monnier @ 2020-07-13  5:38 UTC (permalink / raw)
  To: Blake Miller; +Cc: emacs-devel

> As the name suggests, it can provide you with the fastest emacs startup
> time in the west, by using CRIU checkpoint/restore to "clone" emacsen.

Hmmm... an "unexec" that's not Emacs-specific, interesting,


        Stefan




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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13  5:38 ` Stefan Monnier
@ 2020-07-13  8:28   ` Blake Miller
  2020-07-13 16:21   ` T.V Raman
  1 sibling, 0 replies; 10+ messages in thread
From: Blake Miller @ 2020-07-13  8:28 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

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

That's it exactly. This time the crazy hacks are in the Linux kernel and in
CRIU (and they are there to stay, as they have broad utility), instead of
in glibc (from which they might possibly be removed as emacs is the only
use-case?).

https://lwn.net/Articles/673724/

On Mon, Jul 13, 2020 at 5:38 AM Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> > As the name suggests, it can provide you with the fastest emacs startup
> > time in the west, by using CRIU checkpoint/restore to "clone" emacsen.
>
> Hmmm... an "unexec" that's not Emacs-specific, interesting,
>
>
>         Stefan
>
>

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

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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13  5:38 ` Stefan Monnier
  2020-07-13  8:28   ` Blake Miller
@ 2020-07-13 16:21   ` T.V Raman
  2020-07-13 20:01     ` Blake Miller
  1 sibling, 1 reply; 10+ messages in thread
From: T.V Raman @ 2020-07-13 16:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Blake Miller, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

the biggest drawback I  saw at a quick-read was the need to run as root,
 I'd never run emacs as root.>> As the name suggests, it can provide you with the fastest emacs startup
>> time in the west, by using CRIU checkpoint/restore to "clone" emacsen.
>
> Hmmm... an "unexec" that's not Emacs-specific, interesting,
>
>
>         Stefan
>
>

-- 



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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13 16:21   ` T.V Raman
@ 2020-07-13 20:01     ` Blake Miller
  2020-07-13 20:57       ` T.V Raman
  2020-07-14  2:36       ` Richard Stallman
  0 siblings, 2 replies; 10+ messages in thread
From: Blake Miller @ 2020-07-13 20:01 UTC (permalink / raw)
  To: T.V Raman; +Cc: Stefan Monnier, emacs-devel

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

I'd never run emacs as root either. CRIU has to run as root, but the
processes it creates when restoring a snapshot are regular non-root
processes, just like the one that was checkpointed.

On Mon, Jul 13, 2020 at 4:22 PM T.V Raman <raman@google.com> wrote:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> the biggest drawback I  saw at a quick-read was the need to run as root,
>  I'd never run emacs as root.>> As the name suggests, it can provide you
> with the fastest emacs startup
> >> time in the west, by using CRIU checkpoint/restore to "clone" emacsen.
> >
> > Hmmm... an "unexec" that's not Emacs-specific, interesting,
> >
> >
> >         Stefan
> >
> >
>
> --
>

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

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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13 20:01     ` Blake Miller
@ 2020-07-13 20:57       ` T.V Raman
  2020-07-13 21:17         ` Blake Miller
  2020-07-14  2:36       ` Richard Stallman
  1 sibling, 1 reply; 10+ messages in thread
From: T.V Raman @ 2020-07-13 20:57 UTC (permalink / raw)
  To: blak3mill3r; +Cc: raman, monnier, emacs-devel

I see, I dont understand all the terminology here, which explains my
confusion. As long as neither the emacs daemon or client run as Root,
then that would take away my concern. Could you also elaborate on what
it is that runs as Root?
Blake Miller writes:
 > I'd never run emacs as root either. CRIU has to run as root, but the
 > processes it creates when restoring a snapshot are regular non-root
 > processes, just like the one that was checkpointed.
 > 
 > On Mon, Jul 13, 2020 at 4:22 PM T.V Raman <raman@google.com> wrote:
 > 
 > > Stefan Monnier <monnier@iro.umontreal.ca> writes:
 > >
 > > the biggest drawback I  saw at a quick-read was the need to run as root,
 > >  I'd never run emacs as root.>> As the name suggests, it can provide you
 > > with the fastest emacs startup
 > > >> time in the west, by using CRIU checkpoint/restore to "clone" emacsen.
 > > >
 > > > Hmmm... an "unexec" that's not Emacs-specific, interesting,
 > > >
 > > >
 > > >         Stefan
 > > >
 > > >
 > >
 > > --
 > >

-- 
Id: kg:/m/0285kf1 

-- 
Id: kg:/m/0285kf1 



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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13 20:57       ` T.V Raman
@ 2020-07-13 21:17         ` Blake Miller
  2020-07-13 22:07           ` T.V Raman
  0 siblings, 1 reply; 10+ messages in thread
From: Blake Miller @ 2020-07-13 21:17 UTC (permalink / raw)
  To: T.V Raman; +Cc: Stefan Monnier, emacs-devel

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

Sure. I should improve this in the readme.

What runs as root are these three things only:

1. A little service that is part of my project, written in babashka, called
els-cloner
2. The criu binary
3. the criu-ns python script

That's all. CRIU currently cannot be run as non-root. The other two things
wrap CRIU and so also need to run as root... except I think I could make
the els-cloner service run as an els-cloner user and give it permission
only to invoke criu & criu-ns as root, and I should do that.

On Mon, Jul 13, 2020 at 8:58 PM T.V Raman <raman@google.com> wrote:

> I see, I dont understand all the terminology here, which explains my
> confusion. As long as neither the emacs daemon or client run as Root,
> then that would take away my concern. Could you also elaborate on what
> it is that runs as Root?
> Blake Miller writes:
>  > I'd never run emacs as root either. CRIU has to run as root, but the
>  > processes it creates when restoring a snapshot are regular non-root
>  > processes, just like the one that was checkpointed.
>  >
>  > On Mon, Jul 13, 2020 at 4:22 PM T.V Raman <raman@google.com> wrote:
>  >
>  > > Stefan Monnier <monnier@iro.umontreal.ca> writes:
>  > >
>  > > the biggest drawback I  saw at a quick-read was the need to run as
> root,
>  > >  I'd never run emacs as root.>> As the name suggests, it can provide
> you
>  > > with the fastest emacs startup
>  > > >> time in the west, by using CRIU checkpoint/restore to "clone"
> emacsen.
>  > > >
>  > > > Hmmm... an "unexec" that's not Emacs-specific, interesting,
>  > > >
>  > > >
>  > > >         Stefan
>  > > >
>  > > >
>  > >
>  > > --
>  > >
>
> --
> Id: kg:/m/0285kf1
>
> --
> Id: kg:/m/0285kf1
>

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

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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13 21:17         ` Blake Miller
@ 2020-07-13 22:07           ` T.V Raman
  0 siblings, 0 replies; 10+ messages in thread
From: T.V Raman @ 2020-07-13 22:07 UTC (permalink / raw)
  To: blak3mill3r; +Cc: raman, monnier, emacs-devel

Thanks. Also, for those of  us not in the know, saying what CRIU is
would also alleviate a lot of the concerns 
Blake Miller writes:
 > Sure. I should improve this in the readme.
 > 
 > What runs as root are these three things only:
 > 
 > 1. A little service that is part of my project, written in babashka, called
 > els-cloner
 > 2. The criu binary
 > 3. the criu-ns python script
 > 
 > That's all. CRIU currently cannot be run as non-root. The other two things
 > wrap CRIU and so also need to run as root... except I think I could make
 > the els-cloner service run as an els-cloner user and give it permission
 > only to invoke criu & criu-ns as root, and I should do that.
 > 
 > On Mon, Jul 13, 2020 at 8:58 PM T.V Raman <raman@google.com> wrote:
 > 
 > > I see, I dont understand all the terminology here, which explains my
 > > confusion. As long as neither the emacs daemon or client run as Root,
 > > then that would take away my concern. Could you also elaborate on what
 > > it is that runs as Root?
 > > Blake Miller writes:
 > >  > I'd never run emacs as root either. CRIU has to run as root, but the
 > >  > processes it creates when restoring a snapshot are regular non-root
 > >  > processes, just like the one that was checkpointed.
 > >  >
 > >  > On Mon, Jul 13, 2020 at 4:22 PM T.V Raman <raman@google.com> wrote:
 > >  >
 > >  > > Stefan Monnier <monnier@iro.umontreal.ca> writes:
 > >  > >
 > >  > > the biggest drawback I  saw at a quick-read was the need to run as
 > > root,
 > >  > >  I'd never run emacs as root.>> As the name suggests, it can provide
 > > you
 > >  > > with the fastest emacs startup
 > >  > > >> time in the west, by using CRIU checkpoint/restore to "clone"
 > > emacsen.
 > >  > > >
 > >  > > > Hmmm... an "unexec" that's not Emacs-specific, interesting,
 > >  > > >
 > >  > > >
 > >  > > >         Stefan
 > >  > > >
 > >  > > >
 > >  > >
 > >  > > --
 > >  > >
 > >
 > > --
 > > Id: kg:/m/0285kf1
 > >
 > > --
 > > Id: kg:/m/0285kf1
 > >

-- 
Id: kg:/m/0285kf1 

-- 
Id: kg:/m/0285kf1 



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

* Re: New tool to reduce emacs start-up time on Linux
  2020-07-13 20:01     ` Blake Miller
  2020-07-13 20:57       ` T.V Raman
@ 2020-07-14  2:36       ` Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2020-07-14  2:36 UTC (permalink / raw)
  To: Blake Miller; +Cc: emacs-devel, monnier, raman

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I'd never run emacs as root either. CRIU has to run as root, but the
  > processes it creates when restoring a snapshot are regular non-root
  > processes, just like the one that was checkpointed.

Based on this, Emacs could perhaps, in principle, use CRIU _when_ it
is installed in the system.  But CRIU can't replace the existing
undumping facility, since users must be able to build and dump Emacs
in their own directories too.

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

end of thread, other threads:[~2020-07-14  2:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-13  1:50 New tool to reduce emacs start-up time on Linux Blake Miller
2020-07-13  4:21 ` Rafi Khan
2020-07-13  5:38 ` Stefan Monnier
2020-07-13  8:28   ` Blake Miller
2020-07-13 16:21   ` T.V Raman
2020-07-13 20:01     ` Blake Miller
2020-07-13 20:57       ` T.V Raman
2020-07-13 21:17         ` Blake Miller
2020-07-13 22:07           ` T.V Raman
2020-07-14  2:36       ` Richard Stallman

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

	https://git.savannah.gnu.org/cgit/emacs.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).