Discussion:
Emacs start-up time
(too old to reply)
Sergio Ruiz
2012-11-24 21:29:21 UTC
Permalink
A client has very strict rules about tools one can bring to in house computers. One must declare the editors, compilers and libraries, have them inspected, install everything shortly before starting to work, and remove at the end. As for editors, I need to obey the following directives:

1 -- Distribution must not be larger than 50 MB. Emacs barely fits this tag. VIM fits easily (8.5 MB).

2 -- The virtual machine must be included in the distribution. Well, I guess the virtual machine for elisp is indeed included in the distribution. However, I have a question: What is the size of the virtual machine after compilation?

~/ae$ ls /usr/bin/emacs -lia
7876804 -rwxr-xr-t 2 root root 13669550 2012-11-19 10:55 /usr/bin/emacs

Can I say that the virtual machine occupies 13 MB in the client's hard disk?

3 -- Start up time must be under 3 seconds in the slow compact machines (Atom dual core) that the client's staff uses.

It seems that slow support by people working with Eclipse vexed this client so much that the management imposed these rules. My question is: How big is the elisp virtual machine? Is it smaller than 30 MB?

My second question is: How to measure Emacs start-up time? What I am doing is to run the following script:

~/ae$ time emacs -nw --eval\
"(progn (find-file \"shell.tex\")\
(save-buffers-kill-terminal))"

real 0m0.487s
user 0m0.440s
sys 0m0.044s

In the client's machine, the above test produces a start-up time of 0.487. However, I am not sure whether Emacs really loaded the "shell.tex" file. What is worse, the client's engineers are not convinced either. Therefore, I changed the command line to:

~/ae$ time emacs -nw --eval "(progn (find-file \"shell.tex\")\
(sit-for 2) (save-buffers-kill-terminal))"

real 0m2.504s
user 0m0.460s
sys 0m0.044s

After subtracting the sit-for, I have 2.504. Is there a better way to do this? In VIM, I do the following:

~/ae$ vim --startuptime s.log s.log

Thank you for answering these questions.
Burton Samograd
2012-11-27 00:57:00 UTC
Permalink
Post by Sergio Ruiz
A client has very strict rules about tools one can bring to in house
computers. One must declare the editors, compilers and libraries, have
them inspected, install everything shortly before starting to work,
and remove at the end. As for editors, I need to obey the following
1 -- Distribution must not be larger than 50 MB. Emacs barely fits
this tag. VIM fits easily (8.5 MB).
There used to be barebin distributions that were smaller than this but I
think they've been discontinued.
Post by Sergio Ruiz
2 -- The virtual machine must be included in the distribution. Well, I
guess the virtual machine for elisp is indeed included in the
distribution. However, I have a question: What is the size of the
virtual machine after compilation?
The ELisp VM is contained withing the emacs executable.
Post by Sergio Ruiz
~/ae$ ls /usr/bin/emacs -lia 7876804 -rwxr-xr-t 2 root root 13669550
2012-11-19 10:55 /usr/bin/emacs
Can I say that the virtual machine occupies 13 MB in the client's hard disk?
That would be pretty much correct.
Post by Sergio Ruiz
3 -- Start up time must be under 3 seconds in the slow compact
machines (Atom dual core) that the client's staff uses.
It seems that slow support by people working with Eclipse vexed this
client so much that the management imposed these rules. My question
is: How big is the elisp virtual machine? Is it smaller than 30 MB?
Yes, it's the size of the emacs exe.
Post by Sergio Ruiz
My second question is: How to measure Emacs start-up time? What I am
~/ae$ time emacs -nw --eval\ "(progn (find-file \"shell.tex\")\
(save-buffers-kill-terminal))"
real 0m0.487s user 0m0.440s sys 0m0.044s
In the client's machine, the above test produces a start-up time of
0.487. However, I am not sure whether Emacs really loaded the
"shell.tex" file. What is worse, the client's engineers are not
~/ae$ time emacs -nw --eval "(progn (find-file \"shell.tex\")\
(sit-for 2) (save-buffers-kill-terminal))"
real 0m2.504s user 0m0.460s sys 0m0.044s
After subtracting the sit-for, I have 2.504. Is there a better way to
~/ae$ vim --startuptime s.log s.log
Thank you for answering these questions.
Try this:

emacs -q -nw --eval "(progn (message (format \"Startup Seconds: %s\n\"
(- (float-time after-init-time) (float-time before-init-time))))
(find-file \"shell.tex\") (message (format \"Buffer File Name: %s\"
(buffer-file-name))) (switch-to-buffer \"*Messages*\")
(set-visited-file-name \"messages.txt\") (save-buffer) (kill-emacs))"

Or more readably:

(progn
(message (format "Startup Seconds: %s\n"
(- (float-time after-init-time)
(float-time before-init-time))))
(find-file "shell.tex")
(message (format "Buffer File Name: %s"
(buffer-file-name)))
(switch-to-buffer "*Messages*")
(set-visited-file-name "messages.txt")
(save-buffer)
(kill-emacs))

This will save the *Messaages* buffer to a file called messages.txt
which you can then look at after execution. There you will see the
number of seconds the startup took (see
http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html
for more info) and it will print the buffer file name of the file that
was loaded (which is close to proof that is was loaded).

--
Burton Samograd
Fredrik Staxeng
2012-12-06 12:25:16 UTC
Permalink
Post by Burton Samograd
Post by Sergio Ruiz
A client has very strict rules about tools one can bring to in house
computers. One must declare the editors, compilers and libraries, have
them inspected, install everything shortly before starting to work,
and remove at the end. As for editors, I need to obey the following
1 -- Distribution must not be larger than 50 MB. Emacs barely fits
this tag. VIM fits easily (8.5 MB).
There used to be barebin distributions that were smaller than this but I
think they've been discontinued.
You can run emacs directly from a USB stick. Just double-click on
runemacs.exe.
Post by Burton Samograd
Post by Sergio Ruiz
2 -- The virtual machine must be included in the distribution. Well, I
guess the virtual machine for elisp is indeed included in the
distribution. However, I have a question: What is the size of the
virtual machine after compilation?
The ELisp VM is contained withing the emacs executable.
Yes, but to keep it simple i would say that Emacs does not use any
external dlls, runtimes, or virtual machines.
--
Fredrik Stax\"ang | rot13: ***@hcqngr.hh.fr
This is all you need to know about vi: ESC : q ! RET
Pascal J. Bourguignon
2012-11-27 18:48:32 UTC
Permalink
Post by Sergio Ruiz
A client has very strict rules about tools one can bring to in house
computers. One must declare the editors, compilers and libraries, have
them inspected, install everything shortly before starting to work,
and remove at the end. As for editors, I need to obey the following
1 -- Distribution must not be larger than 50 MB. Emacs barely fits
this tag. VIM fits easily (8.5 MB).
2 -- The virtual machine must be included in the distribution. Well, I
guess the virtual machine for elisp is indeed included in the
distribution. However, I have a question: What is the size of the
virtual machine after compilation?
3 -- Start up time must be under 3 seconds in the slow compact
machines (Atom dual core) that the client's staff uses.
Next time your client goes to the dentist, I hope you can bribe his
dentist to apply a similar set of strict rules:

- the dentist shall use only tools using less than 10 W of power,
- the dentist shall use only tools that he can forge himself,
- the dentist shall use only tools that can be set up in less than 3
seconds.


And similarly if he needs a surgeon, a plumber, a mecanic, or any other
kind of professionnal help.


Fire your client!
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
David Combs
2012-12-16 00:09:28 UTC
Permalink
Post by Pascal J. Bourguignon
Post by Sergio Ruiz
A client has very strict rules about tools one can bring to in house
computers. One must declare the editors, compilers and libraries, have
them inspected, install everything shortly before starting to work,
and remove at the end. As for editors, I need to obey the following
1 -- Distribution must not be larger than 50 MB. Emacs barely fits
this tag. VIM fits easily (8.5 MB).
2 -- The virtual machine must be included in the distribution. Well, I
guess the virtual machine for elisp is indeed included in the
distribution. However, I have a question: What is the size of the
virtual machine after compilation?
3 -- Start up time must be under 3 seconds in the slow compact
machines (Atom dual core) that the client's staff uses.
Next time your client goes to the dentist, I hope you can bribe his
- the dentist shall use only tools using less than 10 W of power,
- the dentist shall use only tools that he can forge himself,
- the dentist shall use only tools that can be set up in less than 3
seconds.
And similarly if he needs a surgeon, a plumber, a mecanic, or any other
kind of professionnal help.
Fire your client!
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
RIGHT ON!

David

Archenoth
2012-11-28 00:02:15 UTC
Permalink
Post by Sergio Ruiz
A client has very strict rules about tools one can bring to in house
computers. One must declare the editors, compilers and libraries, have
them inspected, install everything shortly before starting to work, and
remove at the end. As for editors, I need to obey the following
1 -- Distribution must not be larger than 50 MB. Emacs barely fits this
tag. VIM fits easily (8.5 MB).
2 -- The virtual machine must be included in the distribution. Well, I
guess the virtual machine for elisp is indeed included in the
distribution. However, I have a question: What is the size of the
virtual machine after compilation?
~/ae$ ls /usr/bin/emacs -lia
7876804 -rwxr-xr-t 2 root root 13669550 2012-11-19 10:55 /usr/bin/emacs
Can I say that the virtual machine occupies 13 MB in the client's hard disk?
3 -- Start up time must be under 3 seconds in the slow compact machines
(Atom dual core) that the client's staff uses.
It seems that slow support by people working with Eclipse vexed this
How big is the elisp virtual machine? Is it smaller than 30 MB?
My second question is: How to measure Emacs start-up time? What I am
~/ae$ time emacs -nw --eval\
"(progn (find-file \"shell.tex\")\
(save-buffers-kill-terminal))"
real 0m0.487s
user 0m0.440s
sys 0m0.044s
In the client's machine, the above test produces a start-up time of
0.487. However, I am not sure whether Emacs really loaded the
"shell.tex" file. What is worse, the client's engineers are not
~/ae$ time emacs -nw --eval "(progn (find-file \"shell.tex\")\
(sit-for 2) (save-buffers-kill-terminal))"
real 0m2.504s
user 0m0.460s
sys 0m0.044s
After subtracting the sit-for, I have 2.504. Is there a better way to do
~/ae$ vim --startuptime s.log s.log
Thank you for answering these questions.
Try starting up an Emacs Server and only connect to it with emacsclient
when needed... Emacsclient starts in less than half a second here...

Here is a little howto on how to do it:
http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html
It should also be in your info documentation for Emacs (C-h i)

If you want a tl;dr though, you basically start up Emacs normally, run M-x
server-start, then whenever you want to connect to it and edit a file, you
run "emacsclient 127.0.0.1 <some filename>"...

As for size, there is a lot of things included with Emacs that are not
needed, try for example getting rid of all the modes that you don't use
when you run "du -sh ./* | grep -E M\\s" in your lisp folder...
--
The arch foe
David Combs
2012-12-16 00:08:09 UTC
Permalink
Re start-up time, tell them that you start up THIS
editor ONCE, when you come in to work.

If you're going to edit 50 files during the day, then
the average start-time (allocationi) is divided by
50.

----

Seems to me that if YOU are the "consultant", ie the
expert, you tell THEM the rules.

If you have to, call various nearby computer-science
departments, and find one where the head of the
department has heard of and maybe even used emacs (probably
these days there'll be many who've NEVER even HEARD
of emacs!).

Then get him/her into a phone conversation with he/she
there who makes the rules.




Also, that without emacs it will take you twice or 1.5
times as long, and thus that much more cost, to get
your project done.


David
Loading...