From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GMrnNXaywmB/FgEAgWs5BA (envelope-from ) for ; Fri, 11 Jun 2021 02:46:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gAhaMXaywmCzagAA1q6Kng (envelope-from ) for ; Fri, 11 Jun 2021 00:46:46 +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 8BA132D638 for ; Fri, 11 Jun 2021 02:46:46 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A96D62B25D; Thu, 10 Jun 2021 20:46:38 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 7BCF22B259 for ; Thu, 10 Jun 2021 20:46:35 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id E6F2E5FD25; Thu, 10 Jun 2021 20:46:33 -0400 (EDT) Received: (nullmailer pid 446918 invoked by uid 1000); Fri, 11 Jun 2021 00:46:32 -0000 From: David Bremner To: Felipe Contreras , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] ruby: enable garbage collection using talloc In-Reply-To: <20210517193915.1220114-3-felipe.contreras@gmail.com> References: <20210517193915.1220114-1-felipe.contreras@gmail.com> <20210517193915.1220114-3-felipe.contreras@gmail.com> Date: Thu, 10 Jun 2021 21:46:32 -0300 Message-ID: <874ke5tehj.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: GKSCSG3UXVO4VHPFF3WCP3MJT24FHLUW X-Message-ID-Hash: GKSCSG3UXVO4VHPFF3WCP3MJT24FHLUW X-MailFrom: david@tethera.net 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: 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=1623372406; 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; bh=wRWvCwLaGHH476BDgmMQraNYVqfmibgR9u9rnIv2sCA=; b=MW76NDh6YlgtxW/HG4Sth0GV8WnjnHVwB35y2QKCKU4eXgO88HDBruiJ2JcfExfSbIa5a3 IWyzTKx4Q5K0WM4hJ8rY1h7mmm1rBoJFlTr86f05pTRDmdkj3YbsUUWQPrGDcaOU3mc1SG 3PNf8DgmLo0QkByE4QR0QiOLrRXRm3tFJkC2gRMDLAUF1bvfEbomwYA76hB8neitYxtwmb dxIgVkHibtPd8Oj8QEaWmmZNRWfR775u8FHt7UOV5VRydDibhqVzdZYxElxQYju5mLs0v9 41yrgvx0Q7H0p1HnRCahoLC8i/7BFsg9HMNfiacu/SQaRiVQ1a+ggDpljT6xdw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623372406; a=rsa-sha256; cv=none; b=gm7Erv7MwxfWbJsJGupaxmM97IN0I2A6pnbdL+XhJcEU+lkBnMcXy6TuoINheEMvA2cWkl bj7X+KfgY+HMQW17UWfybk16vYHHY6iX4LfNJT1/H45Xa5NnsQHCPEQBbVMvyWJd1XjB4N o9F3skczx50Z5fzeBq1/JuQVnWnnzkOzDknF1VvycWVlXyFbVW/Mn6faIjBOECQcgkulet 2vNxM/sLL2DnsHtz4vSelgR9w6CdM5bvgLrHLbkKy9fj28BAmUVSCjQwmBcpeEEox/tMdv yGmr7oOlOSTvdYjSs4OD2X2x9aCdaH7hn8JUAgVLTXDcB2F9OCd7zetGTvfraA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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: -2.04 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 8BA132D638 X-Spam-Score: -2.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: yVRPDxRnAQRh 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. 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. d