unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Saving more than 1MB when installed
@ 2012-05-26  1:10 Stefan Monnier
  2012-06-02 19:50 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2012-05-26  1:10 UTC (permalink / raw)
  To: emacs-devel


Try the patch below.  In my tests, adding the pre-loaded elc files in
DOC results in a much larger DOC file (2.4MB vs 650KB), but doesn't save
us anything in the `emacs' executable (neither pure space, nor live heap
or executable size).

I propose we get rid of this "optimization", which is brittle anyway (it
relies on lib-src/make-docfile finding all the docstrings and matching
defvar/defuns in the .elc file, which can be pretty difficult).

Any objection?


        Stefan


=== modified file 'src/Makefile.in'
--- src/Makefile.in	2012-05-22 16:20:27 +0000
+++ src/Makefile.in	2012-05-26 00:56:02 +0000
@@ -424,7 +424,7 @@
 $(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
 	-rm -f $(etc)/DOC
 	$(libsrc)/make-docfile -d $(srcdir) $(SOME_MACHINE_OBJECTS) $(obj) > $(etc)/DOC
-	$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) `sed -n -e 's| \\\\||' -e 's|^[ 	]*$$(lispsource)/||p' $(srcdir)/lisp.mk`
+	#$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) `sed -n -e 's| \\\\||' -e 's|^[ 	]*$$(lispsource)/||p' $(srcdir)/lisp.mk`
 
 $(libsrc)/make-docfile$(EXEEXT):
 	cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT)

=== modified file 'src/lread.c'
--- src/lread.c	2012-05-25 18:06:13 +0000
+++ src/lread.c	2012-05-26 00:59:20 +0000
@@ -3548,7 +3548,7 @@
 	      if (ch == ')')
 		{
 		  if (doc_reference == 1)
-		    return make_number (0);
+		    /* return make_number (0) */;
 		  if (doc_reference == 2)
 		    {
 		      /* Get a doc string from the file we are loading.




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

* Re: Saving more than 1MB when installed
  2012-05-26  1:10 Saving more than 1MB when installed Stefan Monnier
@ 2012-06-02 19:50 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2012-06-02 19:50 UTC (permalink / raw)
  To: emacs-devel

> Try the patch below.  In my tests, adding the pre-loaded elc files in
> DOC results in a much larger DOC file (2.4MB vs 650KB), but doesn't save
> us anything in the `emacs' executable (neither pure space, nor live heap
> or executable size).

After further testing, it turns out that it does indeed save us about
24KB (on a 32bit system) of pure space (which corresponds to the about
3000 docstrings in the preloaded elc files).
And the 2.4M-vs-650K is brought down to 2.4M-vs-1.6M after fixing my
test to include loaddefs.el docstrings.

So for now, I think I'll just leave this alone.  I think a good
direction for change would be to populate the DOC file directly from
Lisp code rather than from make-docfile.c (e.g. from autoload.el and
from the byte-compiler), so we don't need hacks in lread.c that ignore
"things presumed to be docstrings that will hopefully later provided by
Snarf-documentation" and also so we avoid duplicating the docstrings in
loaddefs.el (and .elc files) and DOC.

Actually, changing bytecomp.el to do that it pretty easy (no harder than
what we currently do when outputting docstrings in a format sufficiently
restricted for make-docfile to later find them), the only problem is
in building the whole DOC file: currently we always rebuild it from
scratch, whereas the byte-compiler could only incrementally update it,
so we'd need to change the make-docfile side to update the file rather
than erase&rebuild.


        Stefan



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

end of thread, other threads:[~2012-06-02 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-26  1:10 Saving more than 1MB when installed Stefan Monnier
2012-06-02 19:50 ` Stefan Monnier

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).