[Top][All Lists]

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

bug#8890: 23.3; message writing slows emacs

From: Stefan Monnier
Subject: bug#8890: 23.3; message writing slows emacs
Date: Fri, 16 Sep 2011 10:20:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> "A few milliseconds" sounds negligible, but if it's done at every
>> iteration of a loop whose body takes less than a millisecond to run
>> (we can do a lot of work in a millisecond on today's machines), then
>> it's a major slowdown.
> Then programmers who run those loops should update the progress less
> aggressively.  Redisplay (and infrastructure in general) lack the
> context that would allow them to make good decisions as to when defer
> repeated display.  Only the calling application can know that.

Indeed.  The main problem with changing `message' is that if it is
called too soon after the previous `message' we can't easily say "don't
display this one" since there may not be any subsequent message coming,
so we'd have to stash the last undisplayed message and then try and
figure out good places/times to cause them to be displayed.

So the general approach to fixing those problems is to say "use
progress-reporter-update" since this function has the advantage of
knowing that there will be a `progress-reporter-done' at some later
point, which allows it to skip a message without worries.


reply via email to

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