From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Excessive use of `eassert` Date: Sun, 21 Jan 2024 21:19:30 -0800 Organization: UCLA Computer Science Department Message-ID: <11f4f47c-2873-4268-9bfb-c844545f27a6@cs.ucla.edu> References: <83jzo5x0q8.fsf@gnu.org> <83sf2tv029.fsf@gnu.org> <811d5f03-fad4-47e1-b3fd-2f45229a5ee1@cs.ucla.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------hHKyvUO432KQkoXeIbggMUZ9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15292"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Eli Zaretskii , Stefan Monnier , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 22 06:20:21 2024 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 1rRmjM-0003lx-JX for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Jan 2024 06:20:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRmih-0003zN-Sr; Mon, 22 Jan 2024 00:19:39 -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 1rRmie-0003y3-Kz for emacs-devel@gnu.org; Mon, 22 Jan 2024 00:19:37 -0500 Original-Received: from mail.cs.ucla.edu ([131.179.128.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRmic-0008So-GF; Mon, 22 Jan 2024 00:19:36 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id B6B2D3C00E400; Sun, 21 Jan 2024 21:19:31 -0800 (PST) Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id dQPcGFombXtC; Sun, 21 Jan 2024 21:19:30 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id CD96C3C00E407; Sun, 21 Jan 2024 21:19:30 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu CD96C3C00E407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1705900770; bh=5yxX/p3ko4lxyVVg1GNbX5vijX3cY1RUiL7X5IGtCws=; h=Message-ID:Date:MIME-Version:To:From; b=Tz8fiLXhlimox+wu9E8bz6GDIwdL0mZJg2aqqplZKZJw5FA7Zgxzk+LbaPICqunYm 966RKKPsLFTfnun+eBpVvOiK1FEkYL+IzfO/GEY8U1pXH7ToV7M2JQHMkIZnE6lvRp 7kF+SXajUQ8BqQJUPjp3wnBgeqT6PMjErBEIrSCNzW95kGCF0KbtSI2l6DAVGU+Dkz uO99xueo7jZqogsYWT6MXpZNicfgceF7BbXwnksTH4FqbAMRi/Ud8DEBdMCp3isN2R P89yFE1Z1jA0QQTn3UwM6oq52Wv0iSbwtFWVtED6VRTR4Ae0+s/TH1CX4oXW4S5o7E debzR7mq+SF2A== X-Virus-Scanned: amavis at mail.cs.ucla.edu Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id r94zsZyn1URT; Sun, 21 Jan 2024 21:19:30 -0800 (PST) Original-Received: from [192.168.254.12] (unknown [47.148.192.211]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id A6D1D3C00E400; Sun, 21 Jan 2024 21:19:30 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=131.179.128.66; envelope-from=eggert@cs.ucla.edu; helo=mail.cs.ucla.edu X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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-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:315200 Archived-At: This is a multi-part message in MIME format. --------------hHKyvUO432KQkoXeIbggMUZ9 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024-01-21 02:59, Alan Mackenzie wrote: > I don't think the first patch is correct. With it applied, the code > no longer signals the error of a symbol with position being processed > when symbols_with_pos_enabled is false. That's in the debug build, of > course. Oh, I think I see what you mean: although the patch is correct when callers use XSYMBOL correctly, if a caller has a bug that causes it to call XSYMBOL on a symbol-with-position when symbols_with_pos_enabled is false, then because of the patch this bug in the caller won't be diagnosed by an eassert failure within XSYMBOL in a debug build. I installed the attached to try to fix that. This patch doesn't affect regular builds and so should preserve the minor performance advantage on regular builds. >> When I built with --enable-checking this seemed to help significantly on >> Ubuntu 23.10 x86-64 with GCC 13.2 -O2 (at least looking at the machine >> code; I didn't benchmark). This depends on compiler and platform so it'd >> be helpful if Stefan could try it out on his machine and see whether it >> helps his cases' performance. > > The "significantly" here means the 0.4% speed up in the default build > that you mention in the first patch, does it? Actually I meant the debug build, where I didn't measure the speedup and just looked at a bit of machine code. But as Stefan mentioned there were still issues there. I hope my recent patch to builtin_lisp_symbol has fixed that. I hope this set of patches speeds things up enough on debug builds that Stefan can get his work done. If not, there are other easserts we can tune or remove. (Or perhaps it'd be cheaper to buy Stefan a faster machine - I know I could use one....) --------------hHKyvUO432KQkoXeIbggMUZ9 Content-Type: text/x-patch; charset=UTF-8; name="0001-Add-an-eassert-back-to-XSYMBOL.patch" Content-Disposition: attachment; filename="0001-Add-an-eassert-back-to-XSYMBOL.patch" Content-Transfer-Encoding: base64 RnJvbSAwODhhZmE3ZTJmMDhmNGViNGUzOWFhZTVkYjRmYWEzMzg1N2JmNTQ0IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBTdW4sIDIxIEphbiAyMDI0IDIwOjM0OjAzIC0wODAwClN1YmplY3Q6IFtQQVRD SF0gQWRkIGFuIGVhc3NlcnQgYmFjayB0byBYU1lNQk9MCk1JTUUtVmVyc2lvbjogMS4wCkNv bnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD1VVEYtOApDb250ZW50LVRyYW5zZmVy LUVuY29kaW5nOiA4Yml0CgpQcm9ibGVtIHJlcG9ydGVkIGJ5IEFsYW4gTWFja2VuemllIGlu OgpodHRwczovL2xpc3RzLmdudS5vcmcvci9lbWFjcy1kZXZlbC8yMDI0LTAxL21zZzAwNzU1 Lmh0bWwKKiBzcmMvbGlzcC5oIChYU1lNQk9MKTogSWYgdGhlIGFyZyBpcyBub3QgYSBiYXJl IHN5bWJvbCwgdGhlbgplYXNzZXJ0IChzeW1ib2xzX3dpdGhfcG9zX2VuYWJsZWQpLiAgVGhp cyBzaG91bGRu4oCZdCBhZmZl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