From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Excessive use of `eassert` Date: Fri, 19 Jan 2024 10:50:51 -0500 Message-ID: References: <83jzo5x0q8.fsf@gnu.org> <83sf2tv029.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="16165"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Paul Eggert , Alan Mackenzie , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 19 16:51:42 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 1rQr9h-00040e-R0 for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Jan 2024 16:51:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQr92-0001lx-M2; Fri, 19 Jan 2024 10:51:00 -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 1rQr91-0001lZ-BX for emacs-devel@gnu.org; Fri, 19 Jan 2024 10:50:59 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQr8z-0008Pw-DQ; Fri, 19 Jan 2024 10:50:59 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id EB558100068; Fri, 19 Jan 2024 10:50:54 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1705679453; bh=QvfOL3L5wnSKIJ3J1e8vitQXhCvxuPZFw5qpYXGpSMs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Xy8FNni4OXGsAyRudVEaKpfNtrePMyA2JlNcQWwPyTrWl3KhXeUrlkJLW5apk7fSt jAhxOXRXVFm1TvB179xcy1TR2YrM0KsYVHWVmQpYmDAZC3SbchpcgkbpJBif7JY1Up a+crnZCk1w6lttDTNIO8syoW/OZ9zGBCQhxaIwU58cOF1YJNVy997XTuzF336ztDS1 0Flyd76uJ+JpL0wte76xz3XX3v360bN73URDHtqrh4Wd+7zhlOPo24JqWyXqpvvjYS xuPsuGn4ELhtZgteUozXCaJPzPFjeXVrN19P/sPKuZeRalb/UXAyVgPeEw7RXnvSoF 8FvL/u6NvhW2Q== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CC3DB10004C; Fri, 19 Jan 2024 10:50:53 -0500 (EST) Original-Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A7652120111; Fri, 19 Jan 2024 10:50:53 -0500 (EST) In-Reply-To: <83sf2tv029.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 19 Jan 2024 17:02:06 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:315115 Archived-At: >> AFAICT it's worse than just `NILP`, I think, because every `Qnil` (same >> thing with all other `Q`, I guess) becomes a call to >> `builtin_lisp_symbol` which itself has a call to `make_lisp_symbol`. > > Then how come this is suddenly an issue? Oh, I don't think it's a new issue (tho maybe it is, I have no idea). I just happened to hit `C-z` in Emacs for some unrelated reason and saw on the stack `make_lisp_symbol` and `builtin_lisp_symbol`, which seemed odd, so I looked a bit closer. > since 2016. I use an Emacs build with ENABLE_CHECKING and without > optimizations every day, and while it is indeed slower than the > production build by a factor of 3.5, it is not unbearably slow. Same here. I can't vouch for 3.5 specifically, but 3-4 sounds about right for me as well. Tho I'll also note that (many) years ago the slowdown was lower, more in the 2x ballpark. >> Why do you find this specific assertion important? When building other >> `Lisp_Object`s (like `make_fixnum`) we don't seem to have any >> corresponding assertion that the revere operation (e.g. XFIXNUM) returns >> the original value. > make_fixnum is a trivial bit-shuffling, whereas make_lisp_symbol is > much trickier. `make_fixnum` does "shift + tag", whereas `make_lisp_symbol` does "add + tag". Doesn't seem so terribly more tricky. > Perhaps especially so now that we have symbols-with-positions as well > as bare symbols. `make_lisp_symbol` doesn't touch SWPs. In any case, I'm not insisting. I already removed that assertion from my local branch, which is the one that affects me. My messages was mostly intended to share my discovery/surprise: I always assumed that something like `Qnil` in the source would turn into some kind of constant in the machine code (possibly modulo relocation), regardless of ENABLE_CHECKING. Stefan