unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109157: Compact buffers when idle.
Date: Thu, 19 Jul 2012 18:09:51 -0400	[thread overview]
Message-ID: <jwvtxx3qukc.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <50081B09.5060406@yandex.ru> (Dmitry Antipov's message of "Thu, 19 Jul 2012 18:34:49 +0400")

>> I can't think of any case where that would provide any noticeable
>> benefit (whereas I can think of cases where it just wastes resources).
> Hm... I expect this to be something exotic, like replace-string
> across hundreds of buffers. On the other side, it's quite
> typical code refactoring operation. When I need to change function
> name across the project, I'm using perl just because Emacs is too slow :-(.

I see no evidence that calling compact-buffers from an idle timer will
make any difference to this scenario.

>> The GC is run fairly regularly, also typically while idle, and does the
>> compaction.
> 1. Typically it happens when we're executing byte code, or from eval.c,
>    when we want to be as fast as possible.

Again, I don't see how calling compact-buffers from an idle timer will
make any difference to this case.  BTW, while running the GC in those
cases may be a very visible operation, it's not necessarily inefficient
(unless you consider the usual calls to `free' in non-GC languages as
a unneeded inefficiency), it's just that freeing memory is part of the
needed work and we simply allocated too much memory to be able to
postpone this work to some idle time.

> 2. I don't understand why idle call to Fgarbage_collect is glued with
>    auto-save-timeout. If I don't want to use auto-save, why I shouldn't
>    call GC when idle?

I don't know, probably because it was simpler that way.  Feel free to
propose changes in this area.  Again, I don't see how that is relevant
to calling compact-buffers from an idle timer.

>> So until you can provide some concrete and convincing numbers that show
>> some benefit, I'd ask you to remove that pat of your patch.
> Hm... I suppose that 3GHz CPUs makes a lot of small optimizations almost
> invisible; but I believe it doesn't mean that they're not needed anymore.

I'm not opposed to optimizations, but I do want to first see evidence
that it is indeed an optimization and not a pessimization.

Also note that we're not talking removing some optimization that was
needed back then, but about adding a new optimization, even though it
hasn't seemed to be needed for the last 25 years, hence the higher
requirements.


        Stefan



      reply	other threads:[~2012-07-19 22:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1SrmrL-0004FM-0l@vcs.savannah.gnu.org>
2012-07-19 10:00 ` [Emacs-diffs] /srv/bzr/emacs/trunk r109157: Compact buffers when idle Stefan Monnier
2012-07-19 11:23   ` Dmitry Antipov
2012-07-19 11:54     ` Stefan Monnier
2012-07-19 14:34       ` Dmitry Antipov
2012-07-19 22:09         ` Stefan Monnier [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvtxx3qukc.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).