From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: Skipping unexec via a big .elc file Date: Mon, 24 Oct 2016 05:40:43 -0400 Message-ID: <075B0922-F07A-4FBA-AE71-027E964A5ED4@raeburn.org> 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> <8360ojpndr.fsf@gnu.org> <83shrnm0k1.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1477302088 22997 195.159.176.226 (24 Oct 2016 09:41:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Oct 2016 09:41:28 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 24 11:41:23 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 1bybkY-0002rC-Vg for ged-emacs-devel@m.gmane.org; Mon, 24 Oct 2016 11:40:59 +0200 Original-Received: from localhost ([::1]:45559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bybkb-00051s-B2 for ged-emacs-devel@m.gmane.org; Mon, 24 Oct 2016 05:41:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bybkS-0004za-2Q for emacs-devel@gnu.org; Mon, 24 Oct 2016 05:40:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bybkO-0002GG-4d for emacs-devel@gnu.org; Mon, 24 Oct 2016 05:40:52 -0400 Original-Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:32914) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bybkN-0002FW-TA for emacs-devel@gnu.org; Mon, 24 Oct 2016 05:40:48 -0400 Original-Received: by mail-qk0-x229.google.com with SMTP id n189so227831987qke.0 for ; Mon, 24 Oct 2016 02:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raeburn-org.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=cfFnRIAE8mkWuWewo2HwypqEbckHg0UnLRm+8goGH8s=; b=Q3LP8isga62t21yzdoQWx/H4vvEur1c4ZSlbzFE2tlhqfUn6Z8NZOYbFnpZmSh29ak X6fyiaAUn2SLS8zi0sMAkUpW69cT7VruWQHpYvyjGUcRi97k5uTxeLB0/qoyNmfeecIB UO2IRAsuMNtPoUpFojfrq0m4gwPHLAH5l7qk3gYJVCz+1lM6K9ZhJfkaCcHd5Cn79Eem pV5yqBcIjCWMK34Vq20++hijTJjMWD84woL8Gx57GUzFEp06goeu/0FhvWn0yE4ARWMh VBo24hcwf/JfN/HmSAdzDCjSNJWsXplF8BvM6pg13aFzV+0GfAGREoHdXVdm09sYJShY xDSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=cfFnRIAE8mkWuWewo2HwypqEbckHg0UnLRm+8goGH8s=; b=TazbLReJUjf47nZLYlm1DzjPUQk9a5urzBLcsA4KIyG4Nqsd7ZoRN0PXYxyljXdvog Z7ipIFnBOJfXz3Na/ImIUrL3BSsHbcWgF16zwlrMCJwVKUyymmXdtuThfA6SNgTLI05N Wb4CMpizrZZTKJBm4+Kg3y3GwclZcQVrz/a8Av0su9TGbcOOKvVg7N4GC2a+tkd1NRy2 SI1B86fXL1FjGjdtCDSAny9jkiXSQIRxHBpmKuCnRLLxEz7W30Ylo4kYdkef3T8yQ8y4 S2nhDI5z0GvnVacwBrHcUIV/e36KSwsQUKTY9nEjXhZJ3hd6GjfUe06YAbH6YpWhvJdX VsHA== X-Gm-Message-State: ABUngvd+mND0KubsH3wiey1ibBY1GcL2PjUddIwUIWkCShYmnHT22WL+3DBLq+D8nCw+lg== X-Received: by 10.55.104.15 with SMTP id d15mr15504823qkc.126.1477302046134; Mon, 24 Oct 2016 02:40:46 -0700 (PDT) Original-Received: from [192.168.23.52] (c-50-138-183-136.hsd1.ma.comcast.net. [50.138.183.136]) by smtp.gmail.com with ESMTPSA id j9sm7988058qke.46.2016.10.24.02.40.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 02:40:44 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::229 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:208667 Archived-At: > On Oct 23, 2016, at 21:07, Stefan Monnier = wrote: >=20 >> That sounds strangely long, as I got less than 2 sec with all the >> preloaded *.elc files concatenated to a single file, and that's = before >> I made pure-copy a no-op. >> Another report was that "loadup" with pure-copy short-circuited took >> less than 0.5 sec. See >=20 > Hmm... indeed, I got to 0.72s with his patch (on a different, slower > machine (a Thinkpad X201s, i.e. with a i7 CPU L620 @ 2.00GHz)). >=20 > If I re-add international/characters it goes up a bit to > 0.96s, but still nowhere near the 3s I got on my big .elc file. > [ I wonder what makes loading my big file so slow. ] >=20 > This said, there's still a factor 5-10 to get to "immediate", tho. I think this came up in the thread Eli referred to, but when I=E2=80=99ve = looked at startup time in CANNOT_DUMP builds, a couple of things jumped = out at me: * Garbage collection time. If we=E2=80=99re not trying to dump out as = compact as possible an image, squeezing out every byte is less = important. Drop all of the explicit calls in loadup.el. Consider = raising gc-cons-threshold to the point where it doesn=E2=80=99t trigger = during loadup; maybe set it back after startup completes, or the first = time Emacs is idle more than a couple seconds. * I/O processing time =E2=80=94 not the I/O system calls, but the C = library processing. Change getc to getc_unlocked in charset.c and = lread.c. (And/or change the loading of dumped.elc to read everything = into a buffer and execute code from the buffer, if that might be = faster.) Mutex locking time is costly on Mac OS X, but not exactly free = in glibc either. As I recall, I had startup times under a second without any loadup/dump = preprocessing with these changes. (And all the =E2=80=9Cpurecopy=E2=80=9D= stuff skipped, in a CANNOT_DUMP build.) Your =E2=80=9Cdumped.elc=E2=80=9D might trigger some of the same issues. = If the eventual idea is to stuff the =E2=80=9Cdumped=E2=80=9D data into = a char array to link into the final installed executable, the second = issue is less relevant, though. Did you check whether actually byte compiling the written file made a = difference? Ken=