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: native compilation units Date: Mon, 30 May 2022 21:02:31 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007b19cc05e04454a2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3583"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 31 04:23:36 2022 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 1nvrXj-0000pV-Fm for ged-emacs-devel@m.gmane-mx.org; Tue, 31 May 2022 04:23:35 +0200 Original-Received: from localhost ([::1]:42054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvrXi-0000gc-CA for ged-emacs-devel@m.gmane-mx.org; Mon, 30 May 2022 22:23:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvqHe-00073P-1d for emacs-devel@gnu.org; Mon, 30 May 2022 21:02:54 -0400 Original-Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:36516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvqHX-0002qg-OA for emacs-devel@gnu.org; Mon, 30 May 2022 21:02:52 -0400 Original-Received: by mail-lj1-x233.google.com with SMTP id g12so13039245lja.3 for ; Mon, 30 May 2022 18:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=VeU2zXXlchTZqSbrRtS4gVBb6Mxal4dQqXuJCQ1s81w=; b=dEmgBDBpUQ4kZGxbX7YsqUqLhPkM8bMRSfrfDVjXtG8A5wo8bhqk0orclAgWrXF1Ab BhfDwkqPZhpDCdhSUgsE/tSfptirWeujzmjw3ekxRj5IEEFd1ccPMlHOgIgIVzXVCRsQ bA5sCAQ5QwQIEHGGca6BKrgwAcd8CthTCkhxwrc3Q3cJBucAzMy7xu3JbrIowRrj+hf2 QASSnYQ0Qka0LqQOInDhy5jI0hdHHSqTbK5Y0aflPLir12vobcw11yoKHuzlmqxrGEEf +67V5gw0Lcy9hYMgy90D4DtXzFpKvZvNUEcy1lnQVpimrfiBCJ3/ouh0oUcNGnBBdC6B HHTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VeU2zXXlchTZqSbrRtS4gVBb6Mxal4dQqXuJCQ1s81w=; b=aNznNn73wkdlpGNw+PIefuCXBwt+nKBu8SGjyGXEVKGaXdtiqjEy+Ui9zQBXuDZZDq 7NhO2im2RMfp8ZZvdV0ChIlTcIhGmHgPuaiuzcKPHbcZ3jLg5DySH0MOuq8NGG15qJeb 6ZIY5ZZBwNShcG+cxeJIxNBEmoGHIZr4SkNKW70/6P8Ry7ltdYpvbOGkm5ynRLGERBnI YccRmWXT+a+CHuu7XWwL2U4m6eff5s5PPmrEI97uqMuwiVsUKRuVwO9LL2QbFHO5pcmF wOCy4xcL4UwXb/91pIITU69VJQJVbHGPN7Wm1hVGUOhQUnq9fm1A5zdVS8PRrCiSZ9x/ xodg== X-Gm-Message-State: AOAM531Sh5UENeJmOH88iXw3whGzkAhGsywU6GAwSS4u8KA2cUUHJADd N61LStAI829J5q1EoayAz3Tbz6Jt+vT1MKcl26iKczpjP0A= X-Google-Smtp-Source: ABdhPJz/snOB6Eyglw6T2wOsOjR0IEf3mYufmQVMMXbBYg/Y5sJ/nbfYoy4z/KTRA8eUYEBguhmiSsAMAme0Y2gQ6Wg= X-Received: by 2002:a2e:b8c4:0:b0:253:ebd7:73b7 with SMTP id s4-20020a2eb8c4000000b00253ebd773b7mr23843929ljp.491.1653958963303; Mon, 30 May 2022 18:02:43 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=owinebar@gmail.com; helo=mail-lj1-x233.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 30 May 2022 22:20:59 -0400 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" Xref: news.gmane.io gmane.emacs.devel:290392 Archived-At: --0000000000007b19cc05e04454a2 Content-Type: text/plain; charset="UTF-8" Hi, Since the native compiler does not support linking eln files, I'm curious if anyone has tried combining elisp files as source code files and compiling the result as a unit? Has there been any testing to determine if larger compilation units would be more efficient either in terms of loading or increased optimization opportunities visible to the compiler? Just as a thought experiment, there are about 1500 .el files in the lisp directory. Running from the root of the source tree, let's say I make 2 new directories, ct-lisp and lib-lisp, and then do cp -Rf lisp/* ct-lisp echo "(provide 'lib-emacs)" >lib-lisp/lib-emacs.el find lisp -name '*.el' | while read src; do cat $src >>lib-lisp/lib-emacs.el; done EMACS_LOAD_PATH='' ./src/emacs -batch -nsl --no-site-file --eval "(progn (setq load-path '(\"ct-lisp\" \"lib-lisp\")) (batch-native-compile 't))" lib-lisp/lib-emacs.el find lisp -name '*.el' | while read src; do cat >lib-lisp/$(basename $src) <Hi,
Since the native compiler does not support linking= eln files, I'm curious if anyone has tried combining elisp files as so= urce code files and compiling the result as a unit?
Has there bee= n any testing to determine if larger compilation units would be more effici= ent either in terms of loading or increased optimization opportunities visi= ble to the compiler?
Just as a thought experiment, there are abou= t 1500 .el files in the lisp directory.=C2=A0 Running from the root of the = source tree, let's say I make 2 new directories, ct-lisp and lib-lisp, = and then do
cp -Rf lisp/* ct-lisp
echo "(provide &= #39;lib-emacs)" >lib-lisp/lib-emacs.el
find lisp -name &#= 39;*.el' | while read src; do cat $src >>lib-lisp/lib-emacs.el; d= one
EMACS_LOAD_PATH=3D'' ./src/emacs -batch -nsl --no-sit= e-file --eval "(progn (setq load-path '(\"ct-lisp\" \&qu= ot;lib-lisp\")) (batch-native-compile 't))" lib-lisp/lib-emac= s.el
find lisp -name '*.el' | while read src; do=C2= =A0
=C2=A0 =C2=A0 =C2=A0cat >lib-lisp/$(basename $src) <<= ;EOF
;; -*-no-byte-compile: t; -*-
(require=C2=A0 &= #39;lib-emacs)
EOF
./src/emacs --eval "(setq load-p= ath '(\"lib-lisp\"))" &

Thi= s is just a thought experiment, so assume the machine running this compilat= ion has infinite memory and completes the compilation within a reasonable a= mount of time, and assume this sloppy approach doesn't yield an diverge= nt metarecursion.
If you actually loaded all 1500 modules at once= , what would be the difference between having 1500+ files versus the one la= rge so (assuming all 1500+ were compiled AOT to be fair).

I'm assuming in practice you would want to choose units with a = bit more care, of course.=C2=A0 It just seems like there would be some more= optimal approach for using the native compiler than having all these tiny = compilation units, especially once you get into any significant number of p= ackages.

Lynn

--0000000000007b19cc05e04454a2--