From: Konstantin Kharlamov Date: Thu, 16 Feb 2023 15:07:55 +0000 (+0300) Subject: bug#61489: Increase BLOCK_ALIGN from 1024 to 32768 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=396f46d904ab7509476b0d824ec2e4d9a231a2df;p=emacs.git bug#61489: Increase BLOCK_ALIGN from 1024 to 32768 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. --- diff --git a/src/alloc.c b/src/alloc.c index 6a7037b6bb0..5450586b533 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.