From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#58338: 29.0.50; mapatoms called on more elements than in obarray? Date: Thu, 06 Oct 2022 18:21:47 +0000 Message-ID: <877d1cn77o.fsf@posteo.net> References: <87ilkxlygs.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39515"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58338@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 06 20:39:45 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ogVmb-000A5Q-EQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 20:39:45 +0200 Original-Received: from localhost ([::1]:51112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogVma-0002pS-8M for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 14:39:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogVVS-0007pP-Gd for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 14:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogVVS-0001E8-9A for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 14:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogVVS-0001ET-4H for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 14:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Oct 2022 18:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58338 X-GNU-PR-Package: emacs Original-Received: via spool by 58338-submit@debbugs.gnu.org id=B58338.16650805214730 (code B ref 58338); Thu, 06 Oct 2022 18:22:02 +0000 Original-Received: (at 58338) by debbugs.gnu.org; 6 Oct 2022 18:22:01 +0000 Original-Received: from localhost ([127.0.0.1]:33524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogVVQ-0001ED-KP for submit@debbugs.gnu.org; Thu, 06 Oct 2022 14:22:00 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:49819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogVVM-0001Dx-MK for 58338@debbugs.gnu.org; Thu, 06 Oct 2022 14:21:59 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 641BA240101 for <58338@debbugs.gnu.org>; Thu, 6 Oct 2022 20:21:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665080510; bh=9NB4eEU+RE9+Q6hHXP+9bWcaLBqf50oR0Tg2QSZSwEM=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Po2fpLBuTRiyxXNdV4uGxHNjg0Z1m5Doi45pfuJkShVAGMMfuYSe6nN7j79Dq0lNX N37A2SZRo1ypeLwRYfV9a9s1qDq7PBv35y3wuCcqLZvNX2GJWYC8wlZFy3q2v0UNkD 90Ja5/Cy3qpJ6cjHpGDPn5IgtHUbuGrjOJqgLoSphw/gZJRToT+NbFOISWCP7dlQ/0 TR+uHB3+4Vd9xa3jRKrgOOltaz7VABeJch24Pz+/05SvQ3A4w8YdAkFZ5n0MfCS0fj YpaIV/KDb9lL0/yLVU50NS1obSmRxubbS8obem71JCdYPSASZul38Nt3ToqNnAHlR0 kb+XgL1TRJ1gw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Mk0C10vvjz6tmH; Thu, 6 Oct 2022 20:21:48 +0200 (CEST) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Thu, 06 Oct 2022 19:55:12 +0200") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244700 Archived-At: Gerd M=C3=B6llmann writes: > Philip Kaludercic writes: > >>>>From reading the docstring of `mapatoms', I would assume that this would >> evaluate to t: >> >> (let ((i 0)) >> (mapatoms (lambda (_) (setq i (1+ i))) obarray) >> (=3D (length obarray) i)) >> >> But instead on my system I get (length obarray) =E2=86=9D 15121 and and = i =E2=86=9D >> 78050, which is are at a ratio of 5.16169565505. > > obarray is a hash table. with each array element being a list of symbols > if not empty, for hash collisions. And it's not a hash table of the > kind that make-hash-table makes, which I added much later. And not a > Lisp list of symbols. I see, from the value it appeared to be a flat vector. > With your figures, it seems that there are on average 5 symbols per > bucket. For details you'd have to look at the C code. Eli Zaretskii writes: >> From: Philip Kaludercic >> Date: Thu, 06 Oct 2022 16:16:03 +0000 >>=20 >>=20 >> >From reading the docstring of `mapatoms', I would assume that this would >> evaluate to t: >>=20 >> (let ((i 0)) >> (mapatoms (lambda (_) (setq i (1+ i))) obarray) >> (=3D (length obarray) i)) >>=20 >> But instead on my system I get (length obarray) =E2=86=9D 15121 and and = i =E2=86=9D >> 78050, which is are at a ratio of 5.16169565505. >>=20 >> Also interesting, if I intern a variable "foo", the value of i increases >> to 83106, while (length obarray) stays the same (?) > > You assume that obarray is a flat vector or something? Or how about > if you explain why the above surprised you? In that case what confuses me is that (length obarray) doesn't throw an error. Or what useful information does that give me?