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#61489: [PATCH v2] Increase BLOCK_ALIGN from 1024 to 32768 Date: Thu, 16 Feb 2023 18:07:55 +0300 Message-ID: <20230216150755.27359-1-Hi-Angel@yandex.ru> References: <20230213200006.663502-2-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="20842"; mail-complaints-to="usenet@ciao.gmane.io" To: 61489@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 16 16:09:20 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 1pSfsu-0005Hd-9b for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Feb 2023 16:09:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSfsf-00064D-7w; Thu, 16 Feb 2023 10:09:05 -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 1pSfsc-00063X-DR for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2023 10:09:02 -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 1pSfsc-00034w-2W for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2023 10:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSfsb-0006YT-Nt for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2023 10:09:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <20230213200006.663502-2-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:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61489 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61489-submit@debbugs.gnu.org id=B61489.167656011325146 (code B ref 61489); Thu, 16 Feb 2023 15:09:01 +0000 Original-Received: (at 61489) by debbugs.gnu.org; 16 Feb 2023 15:08:33 +0000 Original-Received: from localhost ([127.0.0.1]:37220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSfs8-0006XV-UP for submit@debbugs.gnu.org; Thu, 16 Feb 2023 10:08:33 -0500 Original-Received: from forward101p.mail.yandex.net ([77.88.28.101]:43614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSfs5-0006XA-T7 for 61489@debbugs.gnu.org; Thu, 16 Feb 2023 10:08:30 -0500 Original-Received: from myt5-18b0513eae63.qloud-c.yandex.net (myt5-18b0513eae63.qloud-c.yandex.net [IPv6:2a02:6b8:c12:571f:0:640:18b0:513e]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 188AB59CEACE for <61489@debbugs.gnu.org>; Thu, 16 Feb 2023 18:08:23 +0300 (MSK) Original-Received: by myt5-18b0513eae63.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 38nsQ3CYMeA1-CH4FFUUU; Thu, 16 Feb 2023 18:08:22 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1676560102; bh=C51/vTi82smkeU/D6lAdfqs9j60DDd2vLmF3g4pJaJY=; h=Message-Id:Date:Subject:To:From; b=tTJsgRyhz2yLreAvjGAaWstSviWhyjebF+vOE1haJ2h0os8BSNYUHrRWBogiBazkQ vnC0XZ/NxIrXm/xJupKKPl7OgJ7rYkwYNGJb7XHpP03fjksTtV2etKtjWWxzGZf/hC UY9Q5WzwYeFOlSwtXs1yljvjEHAh5qNUOmvoVOR4= Authentication-Results: myt5-18b0513eae63.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:255819 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