From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: dangling markers Date: Sun, 30 Jun 2024 09:11:31 +0200 Message-ID: References: <87v81u85hv.fsf@localhost> <87frsx81m2.fsf@localhost> <87cyo180y2.fsf@localhost> <874j9d7zqe.fsf@localhost> <87sewvg6lw.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="32606"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Ihor Radchenko , emacs-devel@gnu.org, Eli Zaretskii , eller.helmut@gmail.com To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 30 09:12:31 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 1sNojf-0008LL-21 for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Jun 2024 09:12:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNoiq-0000fu-1V; Sun, 30 Jun 2024 03:11:40 -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 1sNoin-0000fX-UC for emacs-devel@gnu.org; Sun, 30 Jun 2024 03:11:38 -0400 Original-Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNoil-0006fP-QN; Sun, 30 Jun 2024 03:11:37 -0400 Original-Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-57d1d614049so2391782a12.1; Sun, 30 Jun 2024 00:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719731493; x=1720336293; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OBCYard/ug+LOdV7anvE6rQ1PpXY50ZZ7tx18oboSZY=; b=PGu+pXLBMeWIokhkeA2Ero7UVXGNBCLEPjNbvtkRm0G3qMbidvTggsQegSyeJo3iYi N0OMZxOA6XCQ5HpwDBmyFJ1xeuOuCRDx4iuO1VPI6pa+ZaV8LfKuIASM1fwozRVvlVnp jDVwrN7hQuiWbCx+xOTLqdFQSyJ8KDNloUUjOjAmT54mABAogZNcTFtlMi0xltHWA39n lcSRzu9oPR492K63ZHTh+4BDJXk8hek944ZZNhAUKSX2l0s7FKLwVhPYJkBtmbFoqQ5p RRT43+bjGEKPcLapb9BdxVi/bj2vvitopA3AvGcOOzmZuKWsYlPPvF/xoNoaAR9KtXBD groA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719731493; x=1720336293; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OBCYard/ug+LOdV7anvE6rQ1PpXY50ZZ7tx18oboSZY=; b=A6ce6Id88kvowlaOhwYWb2p4NI9fIyKZMWhLRpP1TGYfpJn9P3y6RIzMxtRVE7v5Rb 6cptSSPFJWpLDqf5MhOQ4Hh5WetR2j/GqOgrQYCG6trDKI3dE7qSusae4oHky9z7U7x9 OJDtKfyIxN+yQP9cexbvL+bPG7ypCvsE+8u0aYIBcXi8H+QNG1zmsb2VFJ5cGzjUhDB2 TA36IrkDtBKK11XqhwO8aJhJoVsyTaOe+4oPERWLcKp6MeF7HmsV3TRY9l8RpxaHNc27 0CrG5a6j1kAaL/yhqlDNyyPiIf5b/jKpUF0tZzgRl1yig4GDoy9N9wcTqt/N4/Ucj1DR aLVg== X-Forwarded-Encrypted: i=1; AJvYcCVGvFiNpe/HUNXOc8giLNChoIZztmwz4zc1WRrI/qyNDwQViuTyt80nUGDQlGXvamg9xppVQGYjdbjGMbjZDhJoGZzJV1uYusinlaYIRJexgjw= X-Gm-Message-State: AOJu0YwfqqS6d8KzjodfOtFXk17kZ6OAXqSznwxVV8H5p8rzye2gHQ4O NvCbSwYTavcZx8PydvCrhBes+qMrANWD71c4MIxjoYTKt4TcigHv X-Google-Smtp-Source: AGHT+IHcIZaq+aClouAvBw8B1dJhfrohZvpGx9ZDirE8hpM7YuMGW6geuZXTPNl81eNevBklaU4ynw== X-Received: by 2002:a05:6402:26c6:b0:57c:cba1:444e with SMTP id 4fb4d7f45d1cf-5879f2b808dmr2102655a12.13.1719731493029; Sun, 30 Jun 2024 00:11:33 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e36a45.dip0.t-ipconnect.de. [217.227.106.69]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-58613817525sm3047382a12.58.2024.06.30.00.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 00:11:32 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Sat, 29 Jun 2024 23:38:16 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x535.google.com 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:320921 Archived-At: Gerd M=C3=B6llmann writes: > Gerd M=C3=B6llmann writes: > >> Gerd M=C3=B6llmann writes: >> >>> And that makes sense. I'll try tomorrow to add something to igc that >>> Ihor can tell us how many markers there are that are allocated in the >>> place Eli showed. >> >> Can't sleep (football), so: >> >> I ended up adding an integer parameter to build_marker, which is >> different for each call site, because the markers built in marker.c >> which Eli pointed to were not the problem, at least for what I did. >> >> I start Emacs, M-x igc-stats which let's me see the number of markers. >> Then repeated g to see the number of markers go up. What I see is a >> rapid growth in markers, by the hundreds each time I refresh, and the >> histogram looks like this >> >> [0 12 3039 0 8 9 19 0 0 0 47365 8 13 0 0 0 0 0 0 0 2618 2618 0 0 0 0 0 >> 0 0 0] >> >> And 10 is >> >> DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0, >> doc: /* Return value of point, as a marker object. */) >> (void) >> { >> return build_marker (current_buffer, PT, PT_BYTE, 10); >> } >> >> Don't know who calls that, but it absolutely dominates. > > Pushed to scratch/igc. Use build-marker-counts to get the numbers. I think I have an idea: What if igc_add_marker records in Lisp_Marker at which index in the weak vector it stored the marker? That would make igc_remove_marker O(1).