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: funcall consing Date: Sat, 01 Jan 2022 09:26:20 +0200 Message-ID: <83pmpbgbmr.fsf@gnu.org> References: <87ee5tm422.fsf@logand.com> <83fsq9gdhw.fsf@gnu.org> <8335m8hazn.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10260"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tom@logand.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 01 08:27:31 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 1n3Yna-0002WX-T2 for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Jan 2022 08:27:31 +0100 Original-Received: from localhost ([::1]:44744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3YnY-0001pQ-Qb for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Jan 2022 02:27:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3Ymb-0000vl-R7 for emacs-devel@gnu.org; Sat, 01 Jan 2022 02:26:29 -0500 Original-Received: from [2001:470:142:3::e] (port=54226 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3YmZ-0000oM-2s; Sat, 01 Jan 2022 02:26:27 -0500 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=3iJSCKNUeNAUJCyJTaKGWuIwBBy2WgxWUit36GmANt8=; b=TP9vs8E4540e V+0xPU8LyOnYXOQ6Ca88l45z4sWsovGXhSCZ2b+l9fqjbbBUbxPmzrmuS4XP4/xmXTAJVFmHOJsvL I6WR/Hm2o6oUi3U2BF1PWk5xwE1ykFwbxOolGzPRSA1jEZoFP24MWCZzasmixL1c/y/pettvv1MB0 F3ZKtPbYPdHs2uSKPCU2zU6CRk5FDjhWM4llb0f1GsH74XZchaFVLLr1wHTcdjMm8xIFIVQsNXgY1 76TzA7UV8piPW7EDGv4ZVx3R3iEtAjdItIT+UBwtNJcPG2y6BUqRH/MnJxI1oR2YwRUEl3YtQglWW kcxcXLEyjqO+3YkSH9vhVA==; Original-Received: from [87.69.77.57] (port=2188 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 1n3YmT-0007oF-JN; Sat, 01 Jan 2022 02:26:21 -0500 In-Reply-To: (message from Richard Stallman on Fri, 31 Dec 2021 23:47:14 -0500) 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:283785 Archived-At: > From: Richard Stallman > Cc: andpuke@foxmail.com, tom@logand.com, emacs-devel@gnu.org > Date: Fri, 31 Dec 2021 23:47:14 -0500 > > > > The `80' indicats the GC has been invoked 80 times. That is the direct > > > indication of "consing". > > > Why are you saying that the number of times GC has been invoked is the > > direct indication of consing? > > It used to be the case, and maybe still is that the decision on > whether to call GC on any given occasion was controlled by how much > space had been allocated since the previous GC. It is still the case. But the details matter in this case: we actually call GC in some strategic points, regardless of how much consing was made, and if it decides that not enough consing has happened since the last call, it does nothing and immediately returns; such "do-nothing" GC cycles then aren't counted in gcs-done. > If that is true nowadays, then calling GC roughly measures the > amount of consing. Not necessarily. If you write Lisp that rarely calls the functions which call GC, then GC won't have enough opportunities to check how much consing has happened. This would produce fewer GC cycles, although each cycle might collect more garbage. Note that one of the examples posted by the OP does exactly twice GC cycles that the other. Which leads me to believe it had twice more opportunities for checking how much consing was done. So I think the caveat not to put too much faith in the _number_ of GC cycles is still something important to keep in mind.