From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: When should ralloc.c be used? (WAS: bug#24358) Date: Thu, 27 Oct 2016 16:39:59 -0400 Message-ID: References: <87twe6sx2g.fsf@users.sourceforge.net> <87eg51ng4r.fsf_-_@users.sourceforge.net> <87k2djwumn.fsf@users.sourceforge.net> <83h98nidvd.fsf@gnu.org> <87eg3rvtsf.fsf@users.sourceforge.net> <83k2dihpm9.fsf@gnu.org> <8760p2wzgj.fsf@users.sourceforge.net> <838ttyhhzu.fsf@gnu.org> <871szqwu51.fsf@users.sourceforge.net> <831szqhbc2.fsf@gnu.org> <87d1itt79z.fsf_-_@users.sourceforge.net> <7baa18d4-2b09-caa8-005e-29008a383ad1@cs.ucla.edu> <83mvhwrgd5.fsf@gnu.org> <8539f38f-9a11-44c3-4de7-bb974c96206c@cs.ucla.edu> <83d1iq5ib1.fsf@gnu.org> <83r3753c8j.fsf@gnu.org> <83r374wh32.fsf@gnu.org> Reply-To: rms@gnu.org NNTP-Posting-Host: blaine.gmane.org Content-Type: text/plain; charset=Utf-8 X-Trace: blaine.gmane.org 1477600828 3108 195.159.176.226 (27 Oct 2016 20:40:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Oct 2016 20:40:28 +0000 (UTC) Cc: eliz@gnu.org, emacs-devel@gnu.org, npostavs@users.sourceforge.net To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 27 22:40:24 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzrTH-00084p-8S for ged-emacs-devel@m.gmane.org; Thu, 27 Oct 2016 22:40:19 +0200 Original-Received: from localhost ([::1]:44483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzrTJ-0005vC-Qw for ged-emacs-devel@m.gmane.org; Thu, 27 Oct 2016 16:40:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzrT8-0005tn-Pd for emacs-devel@gnu.org; Thu, 27 Oct 2016 16:40:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzrT8-0005ub-1y for emacs-devel@gnu.org; Thu, 27 Oct 2016 16:40:10 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzrSx-0005gG-V1; Thu, 27 Oct 2016 16:39:59 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1bzrSx-0004oJ-9Q; Thu, 27 Oct 2016 16:39:59 -0400 In-reply-to: (message from Paul Eggert on Wed, 26 Oct 2016 18:36:02 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208891 Archived-At: [[[ 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. ]]] > Eli has mentioned a simpler approach, where we build an .elc file when > saving Emacs state and load the .elc file during normal startup. The > main worry about this approach is performance. There is no reason why we have to choose between C code and Lisp code. It's worth developing a special-purpose format for this, if that would be considerably faster. However, reading a file that specifies construction of objects is always going to be slower than copying a memory dump. What part of the time could we save with a different format? Here's an idea. We separate (1) creating objects from (2) storing them. We define several operations. We record all objects created by sequence number. We have these ways of creating an object. That object is given the next consecutive sequence number. * intern (specify symbol name) * variable value (specify variable name) * string (specify contents) * integer (specify value) * cons (specify two sequence numbers) * list (specify N sequence numbers) * array (specify N sequence numbers) * expression (specify the expression textually; it gets evalled) And these ways of storing the last object. * store in a variable (specify symbol name) * store in a function cell (specify symbol name) * store in car of cons cell (specify its sequence number) * store in cdr of cons cell (specify its sequence number) * store in array element (specify array sequence number and index) * store in symbol property (specify symbol sequence number and property name) * store using expression (specify a lambda expression with one arg, textually) * store in special internal place (specify a code number to say which place) And one storage reclaimer * discard all sequence numbers back to N. -- Dr Richard Stallman President, Free Software Foundation (gnu.org, fsf.org) Internet Hall-of-Famer (internethalloffame.org) Skype: No way! See stallman.org/skype.html.