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: dangling markers Date: Sat, 29 Jun 2024 22:33:23 +0000 Message-ID: References: <87v81u85hv.fsf@localhost> <86ed8fiug3.fsf@gnu.org> <86bk3jirx7.fsf@gnu.org> <868qynipph.fsf@gnu.org> <87wmm75xze.fsf@localhost> 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="1994"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ihor Radchenko , Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org, eller.helmut@gmail.com To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 30 06:35:21 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 1sNmHZ-0000Hb-KV for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Jun 2024 06:35:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNmGg-0001Uw-Fn; Sun, 30 Jun 2024 00:34:26 -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 1sNgdR-0001to-Dy for emacs-devel@gnu.org; Sat, 29 Jun 2024 18:33:33 -0400 Original-Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNgdP-0004LC-DQ; Sat, 29 Jun 2024 18:33:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1719700408; x=1719959608; bh=Qf6uAGpfDOHjEX7Jg0gVc4vPHDU9mdwtdVcEwXuggAA=; 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=Ezl7OkdSpZAMny0Zl6IEg6o52mpJGQSU618srBd2Q1BnPHqOe3/IpDcMHDhDQNPnL phKQi4UrbLP3ELtPjRVAEgIO0FbKlplnX3Pr7ENyxAUENSJF+hxMcl4LMrT+qIgPwR QJ4W/7/Lf0AUgpjyeZaSFt1okfB4YSsXJxU/A0LP3FFzv+zhvNDhdY9ZcaJVieGul/ STFx7J5LbZyfZjelQIhgKHwhKRYqL5nA9s+Ipg1wBnSbbVsHGSJ2eXjtuW1vSJyIy5 nHtMhLYtDPEPDDNL3Pd3S3o6UHx7Syc6l2I/VVgOOLBhKf//MpBhKncqVM47hPcX5P TfWZs/vBT5ydw== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: a60cf27ed61a9667524c9ee4ea3b26cf2ec0956b Received-SPF: pass client-ip=185.70.43.22; envelope-from=pipcet@protonmail.com; helo=mail-4322.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, 30 Jun 2024 00:34:24 -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:320906 Archived-At: On Saturday, June 29th, 2024 at 21:50, Gerd M=C3=B6llmann wrote: > Ihor Radchenko yantar92@posteo.net writes: >=20 > > Eli Zaretskii eliz@gnu.org writes: > >=20 > > > > Sorry, I've asked not precisely enough. Do we know the percentage o= f > > > > markers generated by that code? I mean, of the 500K markers Ihor se= es, > > > > how many could be spare? > > >=20 > > > I don't know, but a simple instrumentation (or even just a suitably > > > defined breakpoint) will tell. > >=20 > > I looked into this. And it is near 0%. The overwhelming majority of the > > markers are created by something else. I mostly saw save_excursion_save > > in backtraces - it creates transient markers to save point position. >=20 >=20 > Jup, it's point-marker for me. No idea who calls that so often. It probably is save_excursion_save -- while save_excursion_restore calls un= chain_marker on it when the excursion is over, that's not guaranteed to be = near-immediate with the current MPS code, which searches through a potentia= lly long vector until finding the right marker rather than finding it right= away because of the LIFO list. So I think that explains why the MPS code i= s slower... I think from the point of view of igc.c, it might make most sense to make B= UF_MARKERS(buf) a weak hash table once we support those. I've made it a str= ong hash table for now, and that seems usable, but of course it would leak = markers in actual long-running sessions. (Implementing weak hash tables wit= h MPS seems quite difficult, though: you can have only one "dependent objec= t" with strong references per object with weak references, and it cannot be= in a moving pool. And since we can't resize objects that may be pinned by = ambiguous references, well, the weak hash table implementation would look q= uite different from the strong hash tables we have). Of course, Stefan's plan is even better :-) Also, why does igc-info not walk the weak pool? Isn't that where the proble= matic markers are? Pip