From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oOBPOHp412ABiQAAgWs5BA (envelope-from ) for ; Sat, 26 Jun 2021 20:56:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id IF9XM3p412CUYgAAbx9fmQ (envelope-from ) for ; Sat, 26 Jun 2021 18:56:58 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 449AE11730 for ; Sat, 26 Jun 2021 20:56:58 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id D2B42290D6; Sat, 26 Jun 2021 14:56:52 -0400 (EDT) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by mail.notmuchmail.org (Postfix) with ESMTPS id 5D054290C4 for ; Sat, 26 Jun 2021 14:56:50 -0400 (EDT) Received: by mail-wr1-x435.google.com with SMTP id u11so14636979wrw.11 for ; Sat, 26 Jun 2021 11:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9nUpjPK0vtH1Ke0GJ9qnWBhZF2jnJHmtRVEhp0yLVR8=; b=uKjGEwShO0z0ZEgMNUl7eRWy/SJNmrKSl+Io4kN9NYjXonw6OSPH95YdRcd4daUVy1 2loB1Tnk8nh7ozTGqRQ4Fgl/ldp8cAtcwsFLaVaJbFq5/IGdLzmWqDz+xC5h3b50NtTV mNQbk/MfxLKjpTHVC0VZ/kTdoLlg9aMXy7ZtoEtVcKHenBtRupAQKXxf996DLLyk0rI/ 4rLMZFk879QCvXiomojdIcc/EQFsDCY9jNEzMfqliord8DWiaNC7G/Bw91f+EWs/QEtL Tt3z0ua1K6dYtJjzaKuDom4Budnrm0HKqITxiozmc/yozOdqjsGELceJsG4oKdczTs0N ledQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9nUpjPK0vtH1Ke0GJ9qnWBhZF2jnJHmtRVEhp0yLVR8=; b=D6EpUj4QO7IKS9CkFtRXk40knlDQhStxSeMejfhT2GyiKm921xLcFHeLnSSnjno43n NKLJKd7bAw2xN0/ESxdtaEtlqw8FGXzGHBbgu9O34QsoEjdiI53VRdiluCpBNHOL8/QV QD5o7LYQfngPp2qf1CmwDEE0+FSHnPDwCDJ/mxoGbjn2iQWFY2yInEOSlWEf9EnK3uCQ GPG2x2yWEKhPxcPuR9HaX0+OV9Gg+Kp1vasZLU6XFrKILJ2XLYXA006d2t6XFyVbmDMm aCXegh+h5p/+3ielnGHWVgv3hBRZaw7FaSdwyd3ygHX6mRkkNckIpzuIX5awKCbCy91Y pj1Q== X-Gm-Message-State: AOAM531/Aa27raKX5EmIjI/ll2RPMBva5yIqiAwzUxyc7wk5E2bF4Tp+ pDC5/qXRjU7zD5PnLsRnJvazMFI3jUd0BEyDKy8= X-Google-Smtp-Source: ABdhPJxIguZi4POggTMW5Gs6AHw7/iO1wYUEZqZNKpsfI2rP8q8WmFZ56uK3VNLF/Wu/zY4EcHE7Mw1mOrHi+VhTae4= X-Received: by 2002:a5d:61cd:: with SMTP id q13mr18399965wrv.84.1624733809048; Sat, 26 Jun 2021 11:56:49 -0700 (PDT) MIME-Version: 1.0 References: <20210517193915.1220114-1-felipe.contreras@gmail.com> <20210517193915.1220114-3-felipe.contreras@gmail.com> <874ke5tehj.fsf@tethera.net> In-Reply-To: <874ke5tehj.fsf@tethera.net> From: Felipe Contreras Date: Sat, 26 Jun 2021 13:56:38 -0500 Message-ID: Subject: Re: [PATCH 2/2] ruby: enable garbage collection using talloc To: David Bremner Message-ID-Hash: S7JWQDQHUUKGDATL4ITNJP3JQBEKMOSK X-Message-ID-Hash: S7JWQDQHUUKGDATL4ITNJP3JQBEKMOSK X-MailFrom: felipe.contreras@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: "notmuch@notmuchmail.org" , Tomi Ollila X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624733818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=4LIxfOW9FxsMNKBPkebVCzKjVSHrxfIztvfiDkYX+Gk=; b=XzzF9Y9rM1U640Ooibi/EHdTRBiLqJakm+eZBOJfTwYQu4Yz8Kzew03oW+t8C0SlZRlQ6F 5vQhqD1RGwjgOVqbRXKtufFv81tzuRCeaRaEf+40/kbWWV4Mf7KI6NAAGcx9t3iFjtEVsM /5De5XmJ/1kwj0YiIe/X6vHbrIqg8FYHpO3YkbOEkFB4NfG9XtZKAhkyDwqEgve9cL/QE+ htq3yfU+vEVdbVKclDXaoq9DqMRCbuJacBMhRYivdTuhzyUZgw42NMkGoxma/O+cXWAAB6 nT85f+dzJrjXk18Oe+Q3vWLuaJViPddKYkuhhv7VwDEyH6FufuktOSqmCKa0xw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624733818; a=rsa-sha256; cv=none; b=mn+ZE4rMTwgzwDD+TYAB0arsUJZ6A6tX68oTt9gczv3kjYjd/MCrDAL+kIbgnlgmntmkeq GGtcGz1GZSeBI4fvtQYKLfR/RqumWl2g25VPHq8CSYrfXepRyhquMgb+Ih9n22KaZxWv3b nW3LWpjwQ5AIcMaJ0pJdpB1EinLJx6Truct9BlBUKXyaoaI6d5qPEE2UUhywv8n8ozpi9y uBWFGjTyXV+NrXn49tec1qs5kDH845Cloyib/cKNtiIWtAtgNSBG5CHIeUWGoAhuesh+Wo bHaDi0/mQ0AAsGTei8NS0AXGl/IOf1qgQR8FiUxhNsO9tnHVWRLF+V1YPjsf0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=uKjGEwSh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=uKjGEwSh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 449AE11730 X-Spam-Score: -0.96 X-Migadu-Scanner: scn1.migadu.com X-TUID: kJ4eRiaPYeKD On Thu, Jun 10, 2021 at 7:46 PM David Bremner wrote: > > Felipe Contreras writes: > > > We basically steal all the objects from their notmuch parents, therefore > > they are completely under Ruby's gc control. > > > > The order at which these objects are freed does not matter any more, > > because destroying the database does not destroy all the children > > objects, since they belong to Ruby now. > > I guess from a purist point of view this is a kind of layering > violation, since the use of talloc is purportedly an internal > implementation detail of the library. Still, I think it's a reasonable > approach given that the ruby bindings are maintained as part of notmuch, > and we are not very likely to abandon talloc. Yes, some refcount API could be added to all the notmuch objects, but at least I couldn't get talloc refcount stuff work for Ruby, so more work would be needed for that. > I am OK with applying the series as is. The only sensible thing I can > think of at the moment for testing is to run something like the script > of id:20210517193915.1220114-1-felipe.contreras@gmail.com as a "time > test", so not attempt to get valgrind working, but just run it on some > decent size corpuses and see that it it does not crash or leak too much > memory to complete. I have the test ready, the only question is how many times to run it in a loop. 100 times takes about 10 minutes with the large corpus size. -- Felipe Contreras