From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Larger GC thresholds for non-interactive Emacs Date: Sun, 19 Jun 2022 17:23:11 +0800 Message-ID: <874k0hxb0g.fsf@localhost> References: <83bkuzznws.fsf@gnu.org> <877d5mqmkh.fsf@localhost> <83y1y2utnd.fsf@gnu.org> <87r13up587.fsf@localhost> <83o7yyur0l.fsf@gnu.org> <87leu2p3nu.fsf@localhost> <83leu2uewn.fsf@gnu.org> <87r13qv701.fsf@localhost> <83bkuursya.fsf@gnu.org> <87h74l9jk8.fsf@localhost> <83bkutqb3z.fsf@gnu.org> <9778F176-E724-4E61-B0FB-327BCDD316C0@acm.org> <87sfo4epeo.fsf@localhost> <87bkurrc5e.fsf@localhost> <87bkur72b7.fsf@gnus.org> <874k0j40e7.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10681"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , Mattias =?utf-8?Q?Engdeg=C3=A5rd?= , Eli Zaretskii , Tim Cross , rms@gnu.org, Alan Mackenzie , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 19 11:22:50 2022 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 1o2r8s-0002e6-2N for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Jun 2022 11:22:50 +0200 Original-Received: from localhost ([::1]:48820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2r8q-00070a-JZ for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Jun 2022 05:22:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2r8A-0006L4-HJ for emacs-devel@gnu.org; Sun, 19 Jun 2022 05:22:06 -0400 Original-Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:41597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2r88-0001DG-OJ; Sun, 19 Jun 2022 05:22:06 -0400 Original-Received: by mail-pf1-x42e.google.com with SMTP id i64so7765861pfc.8; Sun, 19 Jun 2022 02:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=WhGto8IXIw1jPYKH62iOU3dtlhzrKipnfRHcCr5+Pz0=; b=occQszXAZZPAkl/sDaNdAzP4fg3yosUZJ59rPDPKMkOGkVwjo+JYApR4G37F+t2Xyo zRI1MyBi5bw127jOHCgo+pXZG7/tJxivcEpGEYVKguO3VTkfpAewaLonoX3LXymQbsVv Zy4oHvcUfhIcXmE3L767grhl6IGHzfNCiJyoR7jkkyk0NIXmpqlvVr7gGP7ugeRRS8RU D2bNp4N0Jh43ZDQXeZrm8YK58B6ICHJhx3uG5aVNw7WzAD37BgcOIkCGDg8Hkz9yCqlc 570faL186xDDdta9N5JV8lEUvNG7jO6TBMA0kjYUYukjBDk/+m+DGLzjtK9tYY7FKkLr zVpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=WhGto8IXIw1jPYKH62iOU3dtlhzrKipnfRHcCr5+Pz0=; b=iRmPj8b1+J2P8QDU2ixLvqTuoWID1Jugz6FxpMCCJ1fP1Hm3bMqGpCK9xDeV1kTqIn 6JxlKgXKw7w9TSnWHzAIzo1nrMAtI9s8IOvOq4nWEjduKzdHzFZau2+uyTB03p3fXHSb /0pitwmTSDBjXH2ItzszcyWGev5tIjiRln/4+it47McNRo4UgDykpNNSgeedl1yINMHl OkMrRa95VAEbAQon4FOfRbI63dEmq+apfqCLFtAAvoe5sV4SDn4gUOOIdka4a0ec2ReR YXIffZWddKE/dmstSj4YgPI29zVCmsI7sDgA9fqYb4eamD10gAJV5CkyioGXL+lvu6dU h4pg== X-Gm-Message-State: AJIora82GqiTnRv25SFJzmP3vWThcXBtJZW6wyJa+p2oQwlhRXDCq5H7 Qnt81bVEpwcXv8BeZvfRt1Y= X-Google-Smtp-Source: AGRyM1uLgl521FTfVpahbl6/hjm+jJXrD2VLZuwXLFE/WQ0v+nl4SMhTDerskKytodqTwN6RgU4h9g== X-Received: by 2002:a05:6a00:1744:b0:51b:d4d5:f34 with SMTP id j4-20020a056a00174400b0051bd4d50f34mr18999961pfc.0.1655630522650; Sun, 19 Jun 2022 02:22:02 -0700 (PDT) Original-Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id nr6-20020a17090b240600b001df82551cf2sm6093582pjb.44.2022.06.19.02.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 02:22:02 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=yantar92@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:291410 Archived-At: Stefan Monnier writes: > > % grep GC-26227 ./+make-0.1.log | tail -n 10 > GC-26227 p=0.1 total=18.8M free=1.9M thresold=1.9M > ... > GC-26227 p=0.1 total=18.8M free=1.8M thresold=1.9M > GC-26227 p=0.1 total=145.7M free=32.6M thresold=14.6M > GC-26227 p=0.1 total=132.8M free=60.7M thresold=13.3M > % grep GC-898 ./+make-1.0.log | tail -n 10 > GC-898 p=1.0 total=18.5M free=7.5M thresold=18.5M > ... > GC-898 p=1.0 total=18.8M free=7.3M thresold=18.8M > GC-898 p=1.0 total=145.7M free=32.6M thresold=145.7M > % Now, when I cleared my confusion about the units of gc-cons-percentage, let me share one thought on the above results. In the first series of benchamarks with p=0.1 and total=18.8M, free is roughly equal to threshold. When we increase the threshold, free increases up to some value, but that value is limited by the underlying code: > GC-26227 p=0.1 total=145.7M free=32.6M thresold=14.6M > GC-898 p=1.0 total=145.7M free=32.6M thresold=145.7M In the above two cases, it appears that 32.6M is required to store all the transient values, regardless of the threshold. Hypothesis: 1. When threshold < equilibrium free, we perform redundant GC passes 2. When threshold > equilibrium free, we allocate extra unnecessary memory 3. The optimum memory usage/GC frequency happens at free=threshold Can we test this hypothesis? Best, Ihor