From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: Finalizing 'inhibit-automatic-native-compilation' Date: Sun, 5 Feb 2023 11:22:10 -0500 Message-ID: References: <837cx8cey0.fsf@gnu.org> <83357vauh5.fsf@gnu.org> <837cx6a8me.fsf@gnu.org> <83357ua6ja.fsf@gnu.org> <83zga28ra8.fsf@gnu.org> <83r0vd97s0.fsf@gnu.org> <83lell73yv.fsf@gnu.org> <83k0145guk.fsf@gnu.org> <835ychtcq9.fsf@gnu.org> <83r0v4sgpj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6397"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrea Corallo , monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 05 17:22:51 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOhn0-0001TD-Su for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Feb 2023 17:22:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOhmh-0005fq-8i; Sun, 05 Feb 2023 11:22:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOhme-0005fh-CX for emacs-devel@gnu.org; Sun, 05 Feb 2023 11:22:28 -0500 Original-Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOhmc-0002GP-Bh; Sun, 05 Feb 2023 11:22:27 -0500 Original-Received: by mail-pf1-x42c.google.com with SMTP id t17so6849084pfj.0; Sun, 05 Feb 2023 08:22:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bDQC6n+p4mKZYcz0HuIQJzi3oYUllx+DmvFaInkrr/M=; b=p97A8E3O/AP0b81DJ+aKeRvGcXkXNsdbtExlaBGExnWKTRdy6SJc9LK77WTfbLHNwl 8sz3LQPHG5TMNrzKwlOZ7grG5Ng20GcZr3H4vOQ+PQH+cPAqxyUIToEbKgxguiiW1tAS efoliQQrOq3Bk6kD6OI3RRFkEKFbMAgu/fnm+ed05s6LuC1n1xB0N9TvxdYNQETxMdZB LcfUz9AzsQZg54uMilQKjAFIZCvh232QUFhjzMTrWQIXTHg383s130uQca0B2G1iMIou PvNjW+i6vnOYtwO02uwQb7Dpw9Zlh6nsT8BfLUpNxN0QGoIIhS3Pe+U4YyoTmOcz1VKA Dshw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bDQC6n+p4mKZYcz0HuIQJzi3oYUllx+DmvFaInkrr/M=; b=G9+NqfDzgW2hNVQzUnXwdfMt+BhHQbIRRTt2jQe5zDU7Tkj93GnuLq9Y6BjynuTs6G QKP4WQM5kpXfBkdJKqncc91hoSDlXhoV94/eB2kNRN8Y1nHhMYrk7laUMDMeKmIFeMVf P/qp4FJx+1PBpSXOukhJ17hSAf7a/qLa21EueOPMQLTlKu6hrA7Ddvw1AlugppR8JnQC Q5hVU8RvJ6Yn3tC+WsJReY8hSjq6cF3ysP86yFkYRKgdhNRfTx/rTNGeP72JVFhYle19 ZJFqe8Tv5T8BoT6gAfnQxgUnF7Mw2gLnkvlq+qmpKg42Ycy8pht6i1geKIFtQ7SFveMG LqTQ== X-Gm-Message-State: AO0yUKWEN3hV+Z4cXGyeIsuxi5ArOYxiv7koSX3bRlonC23doQnCTFIy G1W+jh5dfVtMMVleSa8r/svP03iXZOmbX8lvGeeR2JZeptw= X-Google-Smtp-Source: AK7set8I0qIJV/JIjWJOwh8QLs6KOjPY6O3kuaHweJrIHU5li27kTL7YO0Lc6vb0nmghA/0Ro+Pjygl+h3jOBWObb0g= X-Received: by 2002:a63:ef4d:0:b0:434:911a:301 with SMTP id c13-20020a63ef4d000000b00434911a0301mr2619712pgk.50.1675614142417; Sun, 05 Feb 2023 08:22:22 -0800 (PST) In-Reply-To: <83r0v4sgpj.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=owinebar@gmail.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303005 Archived-At: On Sun, Feb 5, 2023 at 2:40 AM Eli Zaretskii wrote: > I asked because Emacs 29 adds some changes specifically intended to > solve the problem of infinite recursion in trampoline compilation. I'll test again after I reimplement the dumping support for text properties, but it might be a while. > > As far as I know, emacs still doesn't support dumping arbitrary > > native-compiled libraries at compile-time. > > What problems do you see if you try? I filed a number of bug reports for tracking purposes at the time. 1. Lack of support for purifying certain object types, including but not limited to text properties 2. Keymap definitions that were incompatible with purification 3. The strict requirements around autoload and load order in compile-time dumping - plenty of libraries just aren't factored to be loaded without autoloads, or weren't at the time of the experiment 4. Issues with variable initialization and code evaluated at load-time rather than at init, as noted at the end of my previous reply 5 There were some issues with docstrings, but those should have been resolved the move to always load those from .elc files. 6. Spawning the asynchronous compile process with whatever dump file the session was loaded with is asking for trouble. It would be better to specify a "known good" dump file, like one limited to loadup with no site files, that has been tested. The compiler process dump file could be a customization variable if tweaks are required. Presumably 1 & 2 will be resolved by removing purification, whenever that happens. Number 3 is fairly easy to resolve by introducing a variable to control when that strict ordering is required, so it can be turned off after the explicit loading is done in "loadup". As Stefan Monnier suggested, the site-load phase is probably best done as a third build phase, following the bootstrap and loadup-only dumps. > > Which is too bad, because the dumped version is a LOT faster to > > startup. > > Are you sure? is this with native-compilation or without it? Very sure. I had dumped emacs with 4000-5000 loaded libraries, all precompiled .eln files, and it would pop up in 5 seconds or less the first time it loaded. Subsequent starts (while the first was still running) appeared to load even faster, I assumed because the eln files are loaded as shared objects and shared between processes by the kernel. > I don't see why it would be faster when loading a dumped Emacs: the > pdumper file records only the names of the *.eln files, not their > contents, so Emacs still has to load all of the *.eln files recorded > in the pdumper file, and that takes time and doesn't change much when > the names are recorded in emacs.pdmp. I need to do proper testing, but part of the speedup is probably due to being able to skip checking whether the source file has the right checksum. I recently submitted a bug report showing that when I had 900+ packages installed and native-compilation enabled for 30.0.50, that startup time is dominated by locate-file, presumably because the eln loader has to find the right source file to check. Otherwise, the length of the load-path would have minimal effect, due to the eln caching. > If you want to dump more libraries than Emacs does by default, why not > modify loadup.el to load those libraries at build time? Then they > will be dumped together with all the rest, and the loading won't need > any changes on your side. See above. Also, I would use site-load to avoid polluting loadup.el. The biggest advantage of dump-emacs-portable is that it doesn't have the prohibition against autoloads and circular requires that dump-mode does, or the problems with purification. I'm happy to submit patches once I've been able to set up the testing infrastructure necessary to be sure they're sound. And actually done the work, which is non-trivial. Lynn