all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Konstantin Kharlamov <hi-angel@yandex.ru>
To: Ihor Radchenko <yantar92@posteo.net>,
	Tyler Dodge <tyler@tdodge.consulting>
Cc: Po Lu <luangruo@yahoo.com>,
	Stefan Kangas <stefankangas@gmail.com>,
	 Emacs developers <emacs-devel@gnu.org>
Subject: Re: "Significant Garbage Collection Improvement For Emacs" - sweep_conses performance improved by 50%?
Date: Mon, 13 Feb 2023 00:58:20 +0300	[thread overview]
Message-ID: <7bd78a657e0d21c2efb81bcdedb9d8bdbb018776.camel@yandex.ru> (raw)
In-Reply-To: <874jrsufoa.fsf@localhost>

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	other threads:[~2023-02-12 21:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29  5:07 "Significant Garbage Collection Improvement For Emacs" - sweep_conses performance improved by 50%? Stefan Kangas
2022-10-29  5:19 ` Christopher Dimech
2022-10-29  5:41 ` Po Lu
2022-10-29  6:07   ` Tyler Dodge
2022-10-29 14:32     ` Stefan Monnier
2022-10-30  0:53       ` Po Lu
2023-02-11 20:10     ` Ihor Radchenko
2023-02-12 21:58       ` Konstantin Kharlamov [this message]
2023-02-13 20:07         ` Konstantin Kharlamov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bd78a657e0d21c2efb81bcdedb9d8bdbb018776.camel@yandex.ru \
    --to=hi-angel@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=stefankangas@gmail.com \
    --cc=tyler@tdodge.consulting \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.