emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Significant Garbage Collection Improvement For Emacs" - sweep_conse


From: Konstantin Kharlamov
Subject: Re: "Significant Garbage Collection Improvement For Emacs" - sweep_conses performance improved by 50%?
Date: Mon, 13 Feb 2023 00:58:20 +0300
User-agent: Evolution 3.46.3

On Sat, 2023-02-11 at 20:10 +0000, Ihor Radchenko wrote:
> "Tyler Dodge" <tyler@tdodge.consulting> writes:
>
> > Since writing that blogpost, I did attempt a few variations of adding
> > prefetch
> > instructions in sweep_conses, but all of the variants I tried ended up
> > having
> > significantly worse performance characteristics than omitting them. That
> > makes
> > it a bit harder for me to believe that it's attributable to cache locality,
> > but like
> > you said, there are a number of other reasons that could be the actual
> > cause.
>
> May I know if there have been any progress on this?
> Is there any help/testing needed?
>
> GC is really making a big impact on Emacs performance. I believe that
> many people would appreciate even few percent overall speed-ups if they
> can be achieved as easily as described in the post. Even if only on
> certain builds.

I did some testing of the change on Archlinux, on Intel i5-7200U.

First of, I run the (test-garbage-collect-large-cons-allocation) from the post,
but I made a small modification to it. As it stands the function takes too much
time and memory for me to wait it out, so I reduced the value `105910837` to
`10591083`.

Running the benchmark three times before and after the change I see reduction of
`Garbage Collection` time by ≈25%.

Then the question that came up in the thread: by how much memory consumption
would increase? I tested `emacs -Q` similarly 3 times before/after, and each
time I measured Emacs PSS. I saw no statistically significant difference.

Interestingly, while repeating previous test with my packages and config loaded
(which includes running malloc_trim()), I see inconsistently lower amount of PSS
with BLOCK_ALIGN=15. At first it was significant, but upon further tests I see
it varies. Either way, it does seem to be a bit lower that with the default
BLOCK_ALIGN=10. So in memory consumption there is either no difference or even a
slight win.

So, yeah, nice change. No idea why it's been 3 months and nobody picked it up
🤷‍♂️ Tho now that I looked at it, I may as well create a patch from it and send
for review. Unless there's opposition, I'm planning on doing so tomorrow.

Thank you Ihor for pinging (I didn't see this thread) and Stefan for the initial
posting of the article here!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]