From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Mon, 28 Nov 2016 18:01:00 -0500 Message-ID: References: <047a67ec-9e29-7e4e-0fb0-24c3e59b5886@dancol.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1480374116 21644 195.159.176.226 (28 Nov 2016 23:01:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2016 23:01:56 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 29 00:01:49 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 1cBUvh-0003sm-Jr for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 00:01:45 +0100 Original-Received: from localhost ([::1]:33567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBUvl-000545-9x for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2016 18:01:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBUvD-00053n-Em for emacs-devel@gnu.org; Mon, 28 Nov 2016 18:01:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBUv9-0000rG-Kv for emacs-devel@gnu.org; Mon, 28 Nov 2016 18:01:15 -0500 Original-Received: from [195.159.176.226] (port=48971 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBUv9-0000r3-EN for emacs-devel@gnu.org; Mon, 28 Nov 2016 18:01:11 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cBUv1-00060L-V1 for emacs-devel@gnu.org; Tue, 29 Nov 2016 00:01:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:sxOTAAa47UaM7Tf74TAZk7vCVAY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:209705 Archived-At: > I've been working on a portable dumper for GNU Emacs. The attached patch is > an early version of this work. Cool! > An additional optimization follows, although this part isn't implemented > yet: we can define a "preferred load address" for the dump and write > relocation information such that if the dump and Emacs end up being where we > expect them to be, we don't have to perform any relocations at all. Oh, so the in-file format is also a valid in-memory format? Great. AFAIK, that's the crucial difference between a "fast .elc loader" and your approach. This should be key to get really good performance (e.g. good enough that it doesn't slow down bootstrap noticeably). > would benefit from compression, which will reduce IO loads: LZ4 reduces the > dump size for me from ~12MB to ~4MB. As in the mmap case, we can throw away Hmm... interesting the "dump one big .elc" approach I played with (which kinda works right now, tho with the known performance issues) leads to a dumped.elc file of a size a bit below 4MB (which gzip compresses down to ~1MB). I assume your system is using 64bit Lisp_Object, right? So on a 32bit Lisp_Object your dump size is probably closer to 6-7MB. > functions pdumper.h --- but even so, it's within 100ms or so of an > unexeced Emacs. 0.1s will still lead to a noticeable slow down of bootstrap, but at least it should be good enough for the usual end-user who doesn't run Emacs in batch mode. > It's also possible to dump an already-dumped Emacs, so it should be possible > for users to have their own dump files. [ FWIW in theory my dumped.elc approach could also work on an already-dumped Emacs, for use by end-users (it basically just prints the contents of the obarray), tho it would indeed need extra work to weed out problems printing objects like markers and such. ] Stefan