From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Lisp files that load cl-lib in problematical ways Date: Wed, 25 Oct 2023 18:02:52 -0400 Message-ID: References: <87il8betof.fsf@dataswamp.org> <83fs3dgxv8.fsf@gnu.org> <835y38qvlg.fsf@gnu.org> <87bkcx6eci.fsf@dataswamp.org> <8734y7p7sz.fsf@dataswamp.org> <83v8b3mcuj.fsf@gnu.org> <87jzrjvze8.fsf@gmx.net> <83r0lrm4gj.fsf@gnu.org> <83edhqu2bj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25019"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: stephen.berman@gmx.net, incal@dataswamp.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 26 00:04:06 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 1qvlyv-0006MY-2r for ged-emacs-devel@m.gmane-mx.org; Thu, 26 Oct 2023 00:04:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvlxz-00007D-Nq; Wed, 25 Oct 2023 18:03:07 -0400 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 1qvlxr-0008V6-Gd for emacs-devel@gnu.org; Wed, 25 Oct 2023 18:03:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvlxl-0001Yx-GM; Wed, 25 Oct 2023 18:02:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=tjNTdj/CVg3cA6ny3LnnWDT6WjFs6NN5eEZ7ZDqAb8E=; b=SGO0aaPpSFCqzZQoKfXn 9eduZfC+TvlLBU15J43TcFnB+zG0U1CzQHseCS6GQLmdwBumDJTr4FNbUYl8/s98Ges5f13nDddRH QrfotWt3gaBqHHcXZsaBDTJmKi2GFAwnfc0HyXgJtij8y7o6BSi/EEfpyDN5SYSs8/W+i7oLEcHJ4 FI/XooBjJDUtm9cdq/ky81A74fC/6cNxAEd/ASSdY58k/qcnSbDV6+Q81byDP0LF9zuJIxSmE55cn I4HyH4cRBswgPf5fMW+nR2X85HVIs+55Ju6QeKWSGnOzZDVzpVqxA/M5H3nHI5xyfOG0dGbDRP3ys +0lfJ5aErcGdBg==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qvlxl-0005qU-19; Wed, 25 Oct 2023 18:02:53 -0400 In-Reply-To: (Andrea Corallo's message of "Thu, 19 Oct 2023 12:11:31 -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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311868 Archived-At: Andrea Corallo writes: > Eli Zaretskii writes: > >>> From: Andrea Corallo >>> Cc: Stephen Berman , incal@dataswamp.org, >>> emacs-devel@gnu.org >>> Date: Thu, 19 Oct 2023 09:44:51 -0400 >>> >>> Okay, I confirm that comp.el loads cl-lib, so any jit compilation >>> triggered loads that. >> >> This is OK, not a problem. >> >>> OTOH one thing we could do, if that's important, is to split the code >>> that only drives the async compilation (that actually happens in a >>> subprocess) so we don't load cl-lib in the Emacs the user is actually >>> using. This should not be that hard (optimism mode on). >> >> I don't see the need, but I will not object if you want to make such >> changes. > > Okay I'll think about it, might be a positive change even leaving aside > the cl-lib discussion. So I did some experimentation (scratch/comp-run branch) where I splitted the code needed to run the (async) native compiler at runtime into a separete file (comp-run.el). I think it's a good change as: 1- instead of loading almost 6000 lines of compiler only code (comp.el+comp-cstr.el not including dependencies) a normal user now has to load only ~500 LOC. The rest will be loaded only by the async workers. 2- it is conceptually correct to divide the code needed at runtime from the one necessary to actually compile. 3- at the first startup on my configuration only gv.el gets native compiled! Limitations so far are that: 1- if any of the async compilation will have to report a warning, warnings.el will require icons.el that will still require cl-lib.el. 2- if cl-lib.el and other dependencies of the native-compiler are not native compiled because of some other package gets loaded, they might stay bytecode. In this case the native compilers running in background _might_ have some performance degradation. I guess is more theoretical than practical but we might want to have a look before committing. Bests! Andrea