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: Opportunistic GC Date: Mon, 8 Mar 2021 15:39:07 +0000 Message-ID: References: <666da624-2f59-2eb4-8e56-f0ad20dd900c@gmx.at> <26ff7447-9c29-a2f2-bf3d-9eac20a95d0f@gmx.at> <838s6xsnsv.fsf@gnu.org> <831rcpsm8y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28751"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rudalics@gmx.at, Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 08 16:41:23 2021 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 1lJI0Z-0007Mt-5r for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Mar 2021 16:41:23 +0100 Original-Received: from localhost ([::1]:35594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJI0Y-0006N0-7u for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Mar 2021 10:41:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJHz2-0005Dd-05 for emacs-devel@gnu.org; Mon, 08 Mar 2021 10:39:48 -0500 Original-Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]:38950) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJHz0-0007HQ-Ka; Mon, 08 Mar 2021 10:39:47 -0500 Original-Received: by mail-ot1-x32f.google.com with SMTP id h22so9571282otr.6; Mon, 08 Mar 2021 07:39:45 -0800 (PST) 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=UC1nr+1H50ThHdabrphkwiywsb6CsjMxlMoMBE44ta4=; b=T9CzWJfdyjeUp4ZXKPPDxXp+M/VhhLM220rQxG4jTrs5kX7Ac0sDNemUFyBK0Br1kY PBtfDoo/4W+3JBYbX4Xcr/xWKYHzI4q39XPjSys3qVfKg4+LGOjnJ2vihCp+Rqfltvvx QNNO6nnbaa/wWr7umKPHzS9J33MF7UoMwlOaJ30SzDLHA1kojdKFWGDNq2FLecxggNHu bWy7WpROM0pl9UkN2qV1EFqiECmvxGprdaG2eGXUDJbw3Th9UBI5pL/0LUYsAvgQ1nZ0 pTS5yrIxOwAe7ptSXb8lRTXPl1idIQTgfmqGH2MbPX24cJEC6jK92Dx6cEl7Dw5XZjI6 Qi0Q== 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=UC1nr+1H50ThHdabrphkwiywsb6CsjMxlMoMBE44ta4=; b=nmYkwjxLFgLuEFTo870Cv0UtfvZWcuhTj5mrYtRtl+1NfmhNdCH7Pikxfur95DVrNB pDQa3BOSGQmK/i+D98LcEXqH7AgyN8sfUDyPjmjZzgTFxYhwgut0R722FJP8lHfpKo5G aV/J/ijWeI+mTSMihnyjQlhy8lr972bR0MUGgXhbV6SNb2ChRRS6zs7Cs/nFYV+g9x7Y h2x+5q0s68ySDa0Pob6FjDz9mU0oiIOs7Oat280J4gFZ+9btJnLT4Hnl2J2MVs3tGwnX Ljz3Z02hrmMX24xpitbIp1YOx9n8fx888pDPvnGGY7wO53ekPtqz+8McZY77E4i/vO8F j4Nw== X-Gm-Message-State: AOAM532ytFzWTtfD2SXzkjE1JBCU/CQHs7LpXu5zp2Y58UMZ9mVnpXhk spE/0Gy8b6/mglzzLrLtKUoNSZKJb0ElAth5qdz59YNMteU= X-Google-Smtp-Source: ABdhPJzG0VNOysM1f03I8xp4Zrsc6FUcsVZxfshRK5cwdQv5NgJeca0nYRzAJfzOp1kNp4ltUdtse086g4dVxvyaGV4= X-Received: by 2002:a9d:6e8d:: with SMTP id a13mr5022713otr.287.1615217983756; Mon, 08 Mar 2021 07:39:43 -0800 (PST) In-Reply-To: <831rcpsm8y.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::32f; envelope-from=pipcet@gmail.com; helo=mail-ot1-x32f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:266196 Archived-At: On Mon, Mar 8, 2021 at 3:23 PM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Mon, 8 Mar 2021 15:02:18 +0000 > > Cc: rudalics@gmx.at, Stefan Monnier , emacs-devel@gnu.org > > > > For conses, it's easy. Instead of keeping the mark bits in the cons > > block, we keep a pointer to the mark bits in the cons block, and > > allocate the mark bits separately and (hopefully) on a different page. > And for others? Symbols: there's probably no need, as there are rarely sessions with millions of symbols. Floats: work just as conses do. Strings: I don't think there are millions of short strings on the heap, usually, but I'm not sure. Anyway, they're just like vectors. Vectors: That's the difficult one; small vectors are kept in vector blocks, and we'd need to have one bit per vector, which would mean one bit for every two lisp words in the vector block, IIUC. So a storage size increase of 1/128, 1/64 on 32-bit machines. Large vectors are, well, large, so we can afford to keep an entire malloc() block for their single mark bit, which would also come out to 1/128 using typical numbers, if I got the math right. But this would be mere optimization, of course. > Also, doesn't it mean you increase the memory required for a cons by a > factor of 1.5, as it now needs one more member (3 words instead of 2)? There'd be one pointer per cons block, not one per cons, so the factor is 1.008 on this machine. Pip