From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#61490: [PATCH v2] Increase BLOCK_ALIGN from 1024 to 32768 Date: Thu, 16 Feb 2023 18:05:09 +0300 Message-ID: <20230216150509.27039-1-Hi-Angel@yandex.ru> References: <20230213200006.663502-1-Hi-Angel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3855"; mail-complaints-to="usenet@ciao.gmane.io" To: 61490@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 16 16:06:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1pSfpr-0000pf-6S for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Feb 2023 16:06:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSfpm-0003Q0-O5; Thu, 16 Feb 2023 10:06:06 -0500 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 1pSfpj-0003IC-97 for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2023 10:06:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSfpi-00022k-U1 for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2023 10:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSfpi-0006Tr-FK for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2023 10:06:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <20230213200006.663502-1-Hi-Angel@yandex.ru> Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Feb 2023 15:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61490 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61490-submit@debbugs.gnu.org id=B61490.167655993424864 (code B ref 61490); Thu, 16 Feb 2023 15:06:02 +0000 Original-Received: (at 61490) by debbugs.gnu.org; 16 Feb 2023 15:05:34 +0000 Original-Received: from localhost ([127.0.0.1]:37216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSfpG-0006Sw-Ci for submit@debbugs.gnu.org; Thu, 16 Feb 2023 10:05:34 -0500 Original-Received: from forward104p.mail.yandex.net ([77.88.28.107]:55748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSfpD-0006Sf-7t for 61490@debbugs.gnu.org; Thu, 16 Feb 2023 10:05:32 -0500 Original-Received: from forward102q.mail.yandex.net (forward102q.mail.yandex.net [IPv6:2a02:6b8:c0e:1ba:0:640:516:4e7d]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 166BE3C1EFB2 for <61490@debbugs.gnu.org>; Thu, 16 Feb 2023 18:05:24 +0300 (MSK) Original-Received: from vla3-aeadfdeff55e.qloud-c.yandex.net (vla3-aeadfdeff55e.qloud-c.yandex.net [IPv6:2a02:6b8:c15:341d:0:640:aead:fdef]) by forward102q.mail.yandex.net (Yandex) with ESMTP id 11E86BF00002 for <61490@debbugs.gnu.org>; Thu, 16 Feb 2023 18:05:24 +0300 (MSK) Original-Received: by vla3-aeadfdeff55e.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id H5n3MnBZd4Y1-NwUzBq6R; Thu, 16 Feb 2023 18:05:23 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1676559923; bh=C51/vTi82smkeU/D6lAdfqs9j60DDd2vLmF3g4pJaJY=; h=Message-Id:Date:Subject:To:From; b=Yqoy8sRoNOllXQYq6Fq6gyAb3p+fFD+xjiUQJlfn8OI0oj/ttaK2dH4UdF7Twhef6 vscIDJmw5qUY3WyngkutCr5JxQk60VKVtYyaySjAJamYB0ugK3upn9PihXUab65xEF VpvCpj7c5aQnzcR+G12GsM22RlxwAPdLI13LDlqA= Authentication-Results: vla3-aeadfdeff55e.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru X-Mailer: git-send-email 2.39.2 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255818 Archived-At: Originally discovered by Tyler Dodge in his article "Significant Garbage Collection Improvement For Emacs". While testing this change on Archlinux system with Intel i5-7200U CPU, average time of garbage collection gets reduced by ≈25%. Other users report improvements up to 50%. While monitoring PSS of emacs with and without customizations loaded before and after the patch, no statistically significant differences were discovered. So overall, this change is a win. * src/alloc.c (BLOCK_ALIGN): increase from 1024 to 32768 --- v2: * Richard Stallman: don't use non-ASCII in the description * Me: mention the report by Ihor Radchenko where performance improved by 50% src/alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alloc.c b/src/alloc.c index c25e81d1dde..d278b01343d 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1083,7 +1083,7 @@ lisp_free (void *block) BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */ /* Byte alignment of storage blocks. */ -#define BLOCK_ALIGN (1 << 10) +#define BLOCK_ALIGN (1 << 15) verify (POWER_OF_2 (BLOCK_ALIGN)); /* Use aligned_alloc if it or a simple substitute is available. -- 2.39.2