master分支最新的commit对gc进行了一点小优化,在macOS上测试有提升

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=396f46d904ab7509476b0d824ec2e4d9a231a2df

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.

我的hackintosh(i7 8700T+32G内存)测试上面url里的testcase从0.80s降到0.5s左右。

2 个赞

我用了大概两周了,打了这个补丁到emacs-29分支,用起来至少没啥不良影响。性能倒是没有专门测过。

今天在git上看到后,正好emacs有3个月没更新了,编译了一下最新的代码。启动速度和之前一样,要1s左右。打开org文件没发现什么问题。感觉不出来gc优化后有没有性能提升。

是,我的感觉也是性能提升感受不是很明显。