From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: native compilation units Date: Fri, 03 Jun 2022 19:05:26 +0300 Message-ID: <834k11d96h.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11461"; mail-complaints-to="usenet@ciao.gmane.io" Cc: akrl@sdf.org, emacs-devel@gnu.org To: Lynn Winebarger Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 03 18:20:47 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 1nxA2Z-0002pQ-7R for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Jun 2022 18:20:47 +0200 Original-Received: from localhost ([::1]:45694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxA2Y-0006mv-16 for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Jun 2022 12:20:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx9o5-0001OJ-HV for emacs-devel@gnu.org; Fri, 03 Jun 2022 12:05:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx9o2-00007p-NG; Fri, 03 Jun 2022 12:05:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=i1jFjBowiVl7fCj4q2UKssRJ6tUlKes+Ze7OhljPk7w=; b=T+RdV+kINlBA WtQOsQYoRzLUpbnK7ePJ3ay1MHaP6DqjMVKDEwMxuRYDWepx5NrIw1xn1rGuRj8/D1eX3cntzAgWD UhJjHI97vN+KDx+bkGMsaDxcnrqk+pXANEU+/FBgZA30Q59g6+LuCyhxe0fGGUBejA/FFMpc57+Jz eSVeDcdEGcuU8fZBAE1Yy6OPjmvDLStWDfUE2Vbe/b0wffVEdviTyPKlmUyV82cOzztJk75jAhyYw GdG1q5IwCh7bGU1D5CXwEyjZoUqADeM1gq3YdJSdlsNTqaBkpm4Wn5hbwUXXHJrlxr6BDjMctnYOO h52gdgtntTa5r58sxIPT+g==; Original-Received: from [87.69.77.57] (port=3978 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx9na-0007BP-R0; Fri, 03 Jun 2022 12:05:46 -0400 In-Reply-To: (message from Lynn Winebarger on Fri, 3 Jun 2022 10:17:25 -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:290633 Archived-At: > From: Lynn Winebarger > Date: Fri, 3 Jun 2022 10:17:25 -0400 > Cc: emacs-devel@gnu.org > > There was a thread in January starting at > https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg01005.html that gets at one scenario. At least in > pre-10 versions in my experience, Windows has not dealt well with large numbers of files in a single > directory, at least if it's on a network drive. There's some super-linear behavior just listing the contents of a > directory that makes having more than, say, a thousand files in a directory impractical. Is this only on networked drives? I have a directory with almost 5000 files, and I see no issues there. Could you show a recipe for observing the slow-down you are describing? > That makes > packaging emacs with all files on the system load path precompiled inadvisable. If you add any significant > number of pre-compiled site-lisp libraries (eg a local elpa mirror), it will get worse. ELPA files are supposed to be compiled into the user's eln-cache directory, not into the native-lisp subdirectory of lib/emacs/, so we are okay there. And users can split their eln-cache directory into several ones (and update native-comp-eln-load-path accordingly) if needed. But I admit that I never saw anything like what you describe, so I'm curious what and why is going on in these cases, and how bad is the slow-down. > Aside from explicit interprocedural optimization, is it possible libgccjit would lay out the code in a more > optimal way in terms of memory locality? > > If the only concern for semantic safety with -O3 is the redefinability of all symbols, that's already the case for > emacs lisp primitives implemented in C. It should be similar to putting the code into a let block with all > defined functions bound in the block, then setting the global definitions to the locally defined versions, except > for any variations in forms with semantics that depend on whether they appear at top-level or in a lexical > scope. It might be interesting to extend the language with a form that makes the unsafe optimizations safe > with respect to the compilation unit. I believe this is an entirely different subject?