From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#58338: 29.0.50; mapatoms called on more elements than in obarray? Date: Thu, 6 Oct 2022 13:04:27 -0500 Message-ID: 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="38509"; mail-complaints-to="usenet@ciao.gmane.io" To: Philip Kaludercic , 58338@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 06 20:39:32 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 1ogVmN-0009ok-AY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 20:39:31 +0200 Original-Received: from localhost ([::1]:51674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogVmL-0002Ke-4m for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 14:39:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogVF1-0000J3-4z for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 14:05:11 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogVF0-0006tL-Ib for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 14:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogVF0-000727-CT for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 14:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Oct 2022 18:05: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.166507947526995 (code B ref 58338); Thu, 06 Oct 2022 18:05:02 +0000 Original-Received: (at 58338) by debbugs.gnu.org; 6 Oct 2022 18:04:35 +0000 Original-Received: from localhost ([127.0.0.1]:33499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogVEY-00071L-K3 for submit@debbugs.gnu.org; Thu, 06 Oct 2022 14:04:34 -0400 Original-Received: from mail-oi1-f173.google.com ([209.85.167.173]:36468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogVEX-000719-MI for 58338@debbugs.gnu.org; Thu, 06 Oct 2022 14:04:34 -0400 Original-Received: by mail-oi1-f173.google.com with SMTP id s192so2908723oie.3 for <58338@debbugs.gnu.org>; Thu, 06 Oct 2022 11:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:mime-version :references:in-reply-to:from:from:to:cc:subject:date; bh=SV4L+n1tT2pquAjDnrh9bxiE5ea8aHq3HATbYP1hiFo=; b=gz0m4JJyMRnXDRskzMAj8hWBINY13gGSkw8PRWCAbad8q0whhoGbjYrjE65TL3FMRJ L+RZPanDLwvhf/QVnkUZQJgJZ5pzIUIEdkbrDcRQX+qmr4yzGN6L7KquJif6u7gOWy5m eG/9RnFN1C0Q1xJxvddgDRrd7z5pS2tQEg8dq/kNr1aGPNumWCc+4wUGcP3ZfWX3lQDs UFA/9psRKUx+KUUJaaMEzUhc8GrGxVQ34JSMBuaksoNVL5jW0KLsRYLGPH3Hj8tXRK63 UGsX5EAbfwAZKA/PxyXkVZuP/VYIAUVSaNoQt3yeOW/Z+knKM31b0iNIj0S7xAfMy5rH kUWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:mime-version :references:in-reply-to:from:x-gm-message-state:from:to:cc:subject :date; bh=SV4L+n1tT2pquAjDnrh9bxiE5ea8aHq3HATbYP1hiFo=; b=Aswcfo5991Bh/8uYTqk8pVeTULR24TBp9XM29a5LShtO4V6fbEcMEsrwDLOyj4yy97 PhS2WvaRcRS32U9o8cVmcV8uXeNKBenJ44n+QOM3Sm1MA5DVySJZzASaqWaC1PenmU46 gq6HrO0nJ2N+BYnPBRdhzNvumbShflLGSXN6xE22PnilETAEM6rLES/SsiiUjx0GX7oY q9o4NgXKHt835IKh9CJBxl2uc8thvu1z0lcjHf9Qr63xFVv65Sqn9PmXLtjQhhh4aBlw C5qaPr/054P+X07/5d9JEwrv/5ZD9wdxix7sRHlFPnF4SKEjBqIkFZMj97r+Qt+DOUvR ii5A== X-Gm-Message-State: ACrzQf2N+ryrl+PrcYo8o6+tP7UNVty164Upojhjvs2JREMcn+jhtJ6Y TkEHJECVBK7rdPQN1kosxtPQL3JOQPG1m1g51Y4= X-Google-Smtp-Source: AMsMyM4xY05OqCMrxmjci5Sawka0/IpUTV9dkVJiCxJkqhpFOWsqKejVEgVrGzzPPvkbUZ/EysRBS3XMd5osF0o/q7E= X-Received: by 2002:a05:6808:1a09:b0:350:1e6a:e469 with SMTP id bk9-20020a0568081a0900b003501e6ae469mr5357636oib.92.1665079467933; Thu, 06 Oct 2022 11:04:27 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 6 Oct 2022 13:04:27 -0500 In-Reply-To: <87ilkxlygs.fsf@posteo.net> X-Hashcash: 1:20:221006:58338@debbugs.gnu.org::fnuhfRiOc8xA2zjo:9Pan 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:244699 Archived-At: 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. > > Also interesting, if I intern a variable "foo", the value of i increases > to 83106, while (length obarray) stays the same (?) In my current long running Emacs session, I'm getting: 15121 119188 Using emacs -Q on 29.0.50: 15121 17228 Using emacs -Q on 27.1: 15121 15880 > Interestingly enough, I'd expect this to at least output a single > message: > > (let ((ht (make-hash-table))) > (mapatoms (lambda (s) (cl-incf (gethash s ht 0)))) > (maphash (lambda (sym i) > (when (> i 1) > (message "%S: %d" sym i))) > ht)) > > but apparently no symbol is invoked twice. Not even by name > > (let ((ht (make-hash-table :test #'equal))) > (mapatoms (lambda (s) (cl-incf (gethash (symbol-name s) ht 0)))) > (maphash (lambda (sym i) > (when (> i 1) > (message "%S: %d" sym i))) > ht)) Same results in Emacs 27.1. > Is this perhaps related to symbol positions? I don't quite understand > bare symbols yet, but it doesn't appear to change anything if I check It seems like this might be older than bare symbols.