From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: weak hash tables Date: Sun, 07 Jul 2024 14:21:21 +0000 Message-ID: <7PXYgVu5A8knQy6Q03cbm6FjO7s022nC0cqCRtUDhQBgA8ZrpLqmoVRgxD8moCTJpB_52ngFaJnW5JIflrzpHe09WcmbRqiHIdWQZE9kQgU=@protonmail.com> References: <8734olzlws.fsf@gmail.com> 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="14526"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Helmut Eller , Ihor Radchenko , Eli Zaretskii , emacs-devel@gnu.org To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 07 18:04:01 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 1sQUMq-0003Zn-Rg for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Jul 2024 18:04:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQUMh-0005rL-Kp; Sun, 07 Jul 2024 12:03:51 -0400 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 1sQSle-0000cT-Fl for emacs-devel@gnu.org; Sun, 07 Jul 2024 10:21:30 -0400 Original-Received: from mail-40133.protonmail.ch ([185.70.40.133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQSlc-00027w-HA for emacs-devel@gnu.org; Sun, 07 Jul 2024 10:21:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1720362086; x=1720621286; bh=iSs0IRY55xuCQDaXnMMXIYP0c8cRPq6mPsbFAyrV3S4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=p0ML9mK8Ae6UBKAm+kiTuXxFH7045xQTY0dWRLiZD9pQFuDmXs6DG6JZ5Q8qGl4m4 nxR9OU549Nzg2AtkKYo5drcb1/EiOnpj2ZiS68CCZ+IJQ8c9c4jEoB/RXS7p9F95wf X39xzx40Owca+camXHKhl3XOSyrU/12dObkqhud5uePnSQUAmZLGE1C1hjsm+ktv7E Eb+W7Oeby477An23ZXW7SXZi2Ka4vXCY58xsmzPTUJ6ACDtpz6MmL1orOt5XXyxpb1 NU2CiOw/2w3Zd/1yFaKrvZRT4BzY993e5XfjzGj2tHjtytslS2Pb3tZhBifU/AHI7E tpuZSeOjntNlA== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 666b1a04b7f0cf3a6f543615c856a17bed1ddfb3 Received-SPF: pass client-ip=185.70.40.133; envelope-from=pipcet@protonmail.com; helo=mail-40133.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 07 Jul 2024 12:03:49 -0400 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:321503 Archived-At: On Sunday, July 7th, 2024 at 11:48, Gerd M=C3=B6llmann wrote: > Gerd M=C3=B6llmann gerd.moellmann@gmail.com writes: > > Pip Cet pipcet@protonmail.com writes: > >=20 > > > > The big > > > > difference to the non-MPS case is that struct interval is subject t= o GC > > > > at all, they are malloc'd without igc. I didn't see another way to > > > > handle their plist otherwise. Making them malloc'd roots would have > > > > meant too many roots for my taste. I have currently ca. 20.000 live > > > > intervals for example, after GC. > > >=20 > > > Does there have to be a big difference at all, > >=20 > > The only thing i can think of is what Helmut already suspected, namely > > barriers. OTOH, it's not really noticeable in other cases, at least her= e > > on macOS. In any case, I wouldn't expect anything remotely that big. > > After all, it's not like a barrier is hit, the client runs a bit, and > > the barrier goes up again. > >=20 > > > or is it possible the test is broken on vanilla Emacs, and it just so > > > happens that GC happens at the right time and hides that bug? > >=20 > > ERT is a dark chapter for me. Digged through it once for the debugger > > handling and giving the right backtraces in condition-case, and didn't > > like it :-). I'd say everything is possible. > >=20 > > > The attached patch to Emacs master makes > > >=20 > > > make -C test lisp/emacs-lisp/ert-tests > > >=20 > > > run out of memory for me (again, on master, nothing special). I don't > > > think it should: all it does is modify the test that runs before. > > >=20 > > > So is it possible this isn't all that MPS-specific? > >=20 > > I have to admit I don't understand how that has the effect it has. Can > > you see where it gets stuck? Deep in the cl-print machinery, generating a buffer which reaches many mega= bytes. I don't think it's actually inflooping, just running out of memory. If I turn cl-print--vector-contents into a nop, it finishes quite quickly, = and succeeds. Oh, I think I found something! "messages" is a let-bound variable containin= g all messages. The backtrace goes there. But the backtrace also prints the= values of let-bound variables in closures, so it'll print all messages rec= ursively, giving us O(N^2) behavior at least... Pip