From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Paul Eggert <eggert@cs.ucla.edu>
Newsgroups: gmane.emacs.devel
Subject: Re: Excessive use of `eassert`
Date: Sun, 21 Jan 2024 20:12:09 -0800
Organization: UCLA Computer Science Department
Message-ID: <1bcc2fc4-da9f-488e-b416-ef4443a3da65@cs.ucla.edu>
References: <jwvsf2u5l8j.fsf-monnier+emacs@gnu.org> <83jzo5x0q8.fsf@gnu.org>
 <jwveded5vrf.fsf-monnier+emacs@gnu.org> <83sf2tv029.fsf@gnu.org>
 <ZarQr591SsuIZwNs@ACM> <811d5f03-fad4-47e1-b3fd-2f45229a5ee1@cs.ucla.edu>
 <jwvplxuznx0.fsf-monnier+emacs@gnu.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------TgMHUoWwl1juASJVpi0854a9"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="25717"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Mozilla Thunderbird
Cc: Alan Mackenzie <acm@muc.de>, Eli Zaretskii <eliz@gnu.org>,
 emacs-devel@gnu.org
To: Stefan Monnier <monnier@iro.umontreal.ca>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 22 05:13:11 2024
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
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 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1rRlgM-0006Qi-4w
	for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Jan 2024 05:13:10 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces@gnu.org>)
	id 1rRlfU-0008Hp-Pv; Sun, 21 Jan 2024 23:12:16 -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 <eggert@cs.ucla.edu>)
 id 1rRlfT-0008H5-07
 for emacs-devel@gnu.org; Sun, 21 Jan 2024 23:12:15 -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 <eggert@cs.ucla.edu>)
 id 1rRlfQ-0003As-U2; Sun, 21 Jan 2024 23:12:14 -0500
Original-Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 88D873C00E400;
 Sun, 21 Jan 2024 20:12:10 -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 04Ntnk128DRY; Sun, 21 Jan 2024 20:12:10 -0800 (PST)
Original-Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 229E83C00E40B;
 Sun, 21 Jan 2024 20:12:10 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 229E83C00E40B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1705896730;
 bh=jx6EYgd+oYMTFsa7ZxLL6o5NIuGTiS8M2wvIxi2YD9Q=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=coO7jB20AA9cquVnIeWZ/iJn8W+gv+LJxaaAd5KaotLfqH5UmBNwrZVJhSi0VyHex
 mh8Iv84YwiD/CJ6uncG+jIAYjRDO00PUr0am5hHTHn26VtC8JcC3GlU2l6ED2Lmi/y
 VGL7ZkOR0yj0TnF41M1Ibg/sGTDqpvhf4ylC5W4hsMktw5SWwIzb9IjX2cmmUnM5x1
 emWGidvjQ78NUkqsUuWF+ZxzMfj8VI40FLgXl2Wp4EKb4S2FtLFlAeOYceLKpGArGr
 jc7Wd+pVi4XunZPR5mdPfaCNvOdHkBuG0JzXo1a0dRxwnDmSPTnD59b84S07qNxl8b
 vS4KE7lYvLITA==
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 4kaUphFtMHgg; Sun, 21 Jan 2024 20:12:10 -0800 (PST)
Original-Received: from [192.168.254.12] (unknown [47.148.192.211])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id 002CF3C00E400;
 Sun, 21 Jan 2024 20:12:09 -0800 (PST)
Content-Language: en-US
In-Reply-To: <jwvplxuznx0.fsf-monnier+emacs@gnu.org>
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." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=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:315197
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/315197>

This is a multi-part message in MIME format.
--------------TgMHUoWwl1juASJVpi0854a9
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 2024-01-21 07:54, Stefan Monnier wrote:
> I still get:
> 
>      (gdb) x/12i init_window
> ...
>         0xbbad5 <init_window+25>:    call   0xa2d57 <make_lisp_symbol>

Thanks, I reproduced that on Ubuntu 23.10 on x86-64 by configuring with 
--enable-checking and compiling with gcc -O0.

I installed the attached patch to try to speed things up for that setup.
--------------TgMHUoWwl1juASJVpi0854a9
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-Speed-up-builtin_lisp_symbol-when-not-optimizing.patch"
Content-Disposition: attachment;
 filename*0="0001-Speed-up-builtin_lisp_symbol-when-not-optimizing.patch"
Content-Transfer-Encoding: base64

RnJvbSBkZjdjNjIxMWNiOTYwYjg4YmMwYWFlZjg1YmFiZjdlOTM4NGQ1ZjJlIE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1
PgpEYXRlOiBTdW4sIDIxIEphbiAyMDI0IDE3OjE4OjIzIC0wODAwClN1YmplY3Q6IFtQQVRD
SF0gU3BlZWQgdXAgYnVpbHRpbl9saXNwX3N5bWJvbCB3aGVuIG5vdCBvcHRpbWl6aW5nCk1J
TUUtVmVyc2lvbjogMS4wCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD1VVEYt
OApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOi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