From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: "Significant Garbage Collection Improvement For Emacs" - sweep_conses performance improved by 50%? Date: Sat, 29 Oct 2022 13:41:40 +0800 Message-ID: <871qqr425n.fsf@yahoo.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14897"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Emacs developers , tyler@tdodge.consulting To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 29 07:54:15 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 1ooenO-0003Y2-25 for ged-emacs-devel@m.gmane-mx.org; Sat, 29 Oct 2022 07:54:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooeml-0004W4-86; Sat, 29 Oct 2022 01:53:35 -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 1ooebW-0007V5-4s for emacs-devel@gnu.org; Sat, 29 Oct 2022 01:41:58 -0400 Original-Received: from sonic315-22.consmr.mail.ne1.yahoo.com ([66.163.190.148]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooebS-0001d6-7x for emacs-devel@gnu.org; Sat, 29 Oct 2022 01:41:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667022108; bh=zNTki8eNYv9b0rY0ruTKET7gwymXuivicARW0AtdEeA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=l5C7j18hyUEYQiyPA/hlqm37D0nAViVit5G1NVyzhFwZ2IarBpAw6vVX2lRe1UVH6sN8rdrdGqQ3GW/ZWamNuSOuQv7C7t9iJjl44c5HnMLtXAVMH+ts9JaBu4h3pFlyKyNGjWw3EeoNApRGgrmX9FemFLnlMLyCafVnXOJ+oyBpJ9ri6C6wgBbutIyHg7AfiPFPijBeZTI9svfAEmX0RXVf7Jqlckn1X6W6FDphDQBbRJli12ij+Dd6RQjZDwl3447gEeNgBiETZqJn85q/VPVFZ5xQGJ0CjtUHsKzsPrvrnb6itOHAus0c0oLQUrQp2yNw/ByMLiS+xCvU2dcgWw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667022108; bh=GFuYKaQcclE5VGv/LmEBdAIH32WIboAcAhm+7sSWVGO=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=edsA737ptjskhH/2LpFyKFV3HFU9QXNtC8PKBpIzNsSsdolji8gqo+br8PxbE+o4S7+S+oZP3r2rI/wutp5kPqMT0pdRVB62KwMl+PAb5WS0FR4LpGGJCX2F86mcZfNbbQj5pdln75h1XDhXfX9VcUFSBLyzbrZR8QVFbq2KHF3SkLfxuf1ONT+bLCqZORv0EaD0UMe17LqcFjbTBlA0riZlyvhP6kFB0Hdwlg1lPvLfO9RTBIyqUZSPgZje6tR89f6r6hAy7fmRx08NAOqrPkA+wpdSEDh6eh8LqDmrzY2E4xu8RCuJZ7Y5WsaVZ2d9bwbmPEBeJM/VSpUShCag4g== X-YMail-OSG: EgeVj9AVM1kX3QOlMI2yNCCwo7PzpHacbBtjPakqO966_x0NYjL32kXKH2Qalqw QMakBwtkYNl8aKAqnVGe3G.fZMEVJRo4U6mgQi_ojrPknvt4E29pCXMnnhe7v273P_rBr9C9SMFr jnQF9VEfg7AgGHncirOSfAQrhY9rF6BR9vEOtUC8vm7NQjZOER5KQpwnzzc4h5qgU4nwv9w4Txo0 VmRJPwulIoq1350l8XWZOETI52Hq58bi9BUdmf_h_5dXr61PgClLJj_Z898k8QEnLSjGxxrlgl3O mB7xy15dXFVVXSN5vXcCAXnDj19q39.pTDWKlgTYdZYE3mwmf3LvSPJv43dt6NAfKlhI9JSXXoiS pIC93GvxNk96NTSDLIUdZ_7vGH.pgjIIUM_jBclUIDMD5GxQX79WRqDjWKMWSw_yBsCowAiHfXOn 5fdAdzEpJG5aQCDTIKAYl3DcbCBUDcJVALz2BG3bkYIPbVhnBFw1f5W_WIiGHJOfT12TLTS4fZpQ jX66RSclvllyFRnYT4zndoUZu8rQFKuEuvD_CqYl1shZDqeSMwvY1StLdQgNWpr1Li81iRSkONXU sAcRAZ_IAirgBRCyUQF3TjrQVi.kXahhFCogKSm7AK8bNZkAav5b4_Hplon5X0vZVT9bU3OGt9CP Xs2zNjAwxrzmJlmLNtlQLUGbeIX0rUhMrciktGNvedPutu0eRldNyb1YlBVaIyipsG2Jk6IGbYQw AissivoTT8zRFp0Mw95Llvt_kgQa6vSgEQVn_9VNu2ebcQnzVAFzboHrGET18UftFlHDPss2Gshe n2nifG5UmWsUqFJ3UxR.CNmLCQvD8_GxKqBuXO9sUL X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Sat, 29 Oct 2022 05:41:48 +0000 Original-Received: by hermes--production-sg3-74fb94585-btmps (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 972057002084dd6fbda11c38db2650e4; Sat, 29 Oct 2022 05:41:46 +0000 (UTC) In-Reply-To: (Stefan Kangas's message of "Sat, 29 Oct 2022 07:07:25 +0200") X-Mailer: WebService/1.1.20783 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.190.148; envelope-from=luangruo@yahoo.com; helo=sonic315-22.consmr.mail.ne1.yahoo.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, RCVD_IN_MSPIKE_H2=-0.001, 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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298717 Archived-At: Stefan Kangas writes: > In this blog post > > https://tdodge.consulting/blog/living-the-emacs-garbage-collection-dream > > the author asserts that a one-line patch "reduces the total wall clock > duration for sweep conses execution by approximately 50%", at least in > one benchmark. There are some caveats; read the blog post for the > full story. My guess is that the blog post overestimates the performance cost of branch predictor misses, and underestimates the real effect of the change, which is making sweep_conses walk an array more and a linked list less. Which is also more cache friendly, but sweeping any kind of array is intrinsically faster than doing the same to a linked list for any number of other reasons. I don't know what the memory consumption impact of such a change would be since I haven't tried it myself.