* Re: Default history-length should be higher
2014-01-25 7:56 ` Tom
@ 2014-01-25 8:05 ` Tom
2014-01-25 8:45 ` Drew Adams
2014-01-26 5:00 ` Michael Welsh Duggan
2 siblings, 0 replies; 16+ messages in thread
From: Tom @ 2014-01-25 8:05 UTC (permalink / raw)
To: emacs-devel
Tom <adatgyujto <at> gmail.com> writes:
>
> All users should know at least M-r, it's in the manual, so it
> should be no argument against a longer history list.
>
I checked the manual to make sure and I also learned that isearch can
be used to search the history which was new for me.
One always learns new things with emacs and isearch seems a quite
efficent way to search through a longer history:
If an incremental search fails in the minibuffer, it tries searching
the minibuffer history. *Note Minibuffer History::. You can visualize
the minibuffer and its history as a series of "pages", with the
earliest history element on the first page and the current minibuffer
on the last page. A forward search, `C-s', searches forward to later
pages; a reverse search, `C-r', searches backwards to earlier pages.
Like in ordinary buffer search, a failing search can wrap around, going
from the last page to the first page or vice versa.
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: Default history-length should be higher
2014-01-25 7:56 ` Tom
2014-01-25 8:05 ` Tom
@ 2014-01-25 8:45 ` Drew Adams
2014-01-26 5:00 ` Michael Welsh Duggan
2 siblings, 0 replies; 16+ messages in thread
From: Drew Adams @ 2014-01-25 8:45 UTC (permalink / raw)
To: Tom, emacs-devel
> > BTW, whether someone finds a history list of 1000 elements to be
> > long or reasonable might also have to do with how they access its
> > elements.
> >
> > If someone typically just cycles among elements using, say, `M-p',
> > instead of searching (using, say, `M-r') or completing, then 1000
> > would generally be far too long a list - as would even 100 probably.
> > (I tend to complete against the history list.)
>
> All users should know at least M-r, it's in the manual, so it
> should be no argument against a longer history list.
I didn't mention it as an argument against a longer history list
(of which I am in favor). My point was that what is long for one
person might be short for another person, depending on how they
typically access the history.
The mere fact that `M-r' is documented does not mean that user X
makes much use of it. Some people are cycling drones.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Default history-length should be higher
2014-01-25 7:56 ` Tom
2014-01-25 8:05 ` Tom
2014-01-25 8:45 ` Drew Adams
@ 2014-01-26 5:00 ` Michael Welsh Duggan
2014-01-26 19:22 ` Bozhidar Batsov
2 siblings, 1 reply; 16+ messages in thread
From: Michael Welsh Duggan @ 2014-01-26 5:00 UTC (permalink / raw)
To: emacs-devel
Tom <adatgyujto@gmail.com> writes:
> Drew Adams <drew.adams <at> oracle.com> writes:
>>
>> BTW, whether someone finds a history list of 1000 elements to be
>> long or reasonable might also have to do with how they access its
>> elements.
>>
>> If someone typically just cycles among elements using, say, `M-p',
>> instead of searching (using, say, `M-r') or completing, then 1000
>> would generally be far too long a list - as would even 100 probably.
>> (I tend to complete against the history list.)
>
> All users should know at least M-r, it's in the manual, so it
> should be no argument against a longer history list.
FWIW, I've been using emacs for many, many years, and did not know about
M-r. On the other hand, I don't object to increasing the history size,
because now I know about M-r! Thanks!
--
Michael Welsh Duggan
(md5i@md5i.com)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Default history-length should be higher
2014-01-26 5:00 ` Michael Welsh Duggan
@ 2014-01-26 19:22 ` Bozhidar Batsov
2014-01-26 19:44 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Bozhidar Batsov @ 2014-01-26 19:22 UTC (permalink / raw)
To: Michael Welsh Duggan; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]
While we're at it - why not increase the default `gc-cons-threshold' as
well. Currently the default is 0.8 MB, which seems super-conservative given
today most computers have 1GB+ of memory. Code that creates a lot of
objects would obviously be impacted significantly, since GC would be
performed frequently. Setting it to something in between 10MB and 50MB
seems much more reasonable to me.
On 26 January 2014 07:00, Michael Welsh Duggan <mwd@md5i.com> wrote:
> Tom <adatgyujto@gmail.com> writes:
>
> > Drew Adams <drew.adams <at> oracle.com> writes:
> >>
> >> BTW, whether someone finds a history list of 1000 elements to be
> >> long or reasonable might also have to do with how they access its
> >> elements.
> >>
> >> If someone typically just cycles among elements using, say, `M-p',
> >> instead of searching (using, say, `M-r') or completing, then 1000
> >> would generally be far too long a list - as would even 100 probably.
> >> (I tend to complete against the history list.)
> >
> > All users should know at least M-r, it's in the manual, so it
> > should be no argument against a longer history list.
>
> FWIW, I've been using emacs for many, many years, and did not know about
> M-r. On the other hand, I don't object to increasing the history size,
> because now I know about M-r! Thanks!
>
> --
> Michael Welsh Duggan
> (md5i@md5i.com)
>
>
[-- Attachment #2: Type: text/html, Size: 2074 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Default history-length should be higher
2014-01-26 19:22 ` Bozhidar Batsov
@ 2014-01-26 19:44 ` Eli Zaretskii
2014-01-26 20:19 ` Bozhidar Batsov
2014-01-26 20:34 ` Óscar Fuentes
2014-01-26 23:44 ` Trent W. Buck
2014-01-26 23:52 ` Stefan Monnier
2 siblings, 2 replies; 16+ messages in thread
From: Eli Zaretskii @ 2014-01-26 19:44 UTC (permalink / raw)
To: Bozhidar Batsov; +Cc: mwd, emacs-devel
> Date: Sun, 26 Jan 2014 21:22:37 +0200
> From: Bozhidar Batsov <bozhidar@batsov.com>
> Cc: emacs-devel <emacs-devel@gnu.org>
>
> While we're at it - why not increase the default `gc-cons-threshold' as
> well. Currently the default is 0.8 MB, which seems super-conservative given
> today most computers have 1GB+ of memory. Code that creates a lot of
> objects would obviously be impacted significantly, since GC would be
> performed frequently. Setting it to something in between 10MB and 50MB
> seems much more reasonable to me.
Did you try that? If not, please do. In my experience, your
suggestion has a downside: the GC indeed happens less frequently, but
when it does, it takes an annoyingly long time. I find it easier to
tolerate many GCs that run to completion in less than a second, than
to have a few GCs that take several seconds each.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Default history-length should be higher
2014-01-26 19:44 ` Eli Zaretskii
@ 2014-01-26 20:19 ` Bozhidar Batsov
2014-01-26 20:34 ` Óscar Fuentes
1 sibling, 0 replies; 16+ messages in thread
From: Bozhidar Batsov @ 2014-01-26 20:19 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Michael Welsh Duggan, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]
On 26 January 2014 21:44, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sun, 26 Jan 2014 21:22:37 +0200
> > From: Bozhidar Batsov <bozhidar@batsov.com>
> > Cc: emacs-devel <emacs-devel@gnu.org>
> >
> > While we're at it - why not increase the default `gc-cons-threshold' as
> > well. Currently the default is 0.8 MB, which seems super-conservative
> given
> > today most computers have 1GB+ of memory. Code that creates a lot of
> > objects would obviously be impacted significantly, since GC would be
> > performed frequently. Setting it to something in between 10MB and 50MB
> > seems much more reasonable to me.
>
> Did you try that? If not, please do. In my experience, your
> suggestion has a downside: the GC indeed happens less frequently, but
> when it does, it takes an annoyingly long time. I find it easier to
> tolerate many GCs that run to completion in less than a second, than
> to have a few GCs that take several seconds each.
>
I've tested the flx package https://github.com/lewang/flx suggestion to
bump the gc-threshold and
the package definitely started working noticeably faster. I haven't
noticed particularly long GC pauses.
Hopefully when multi-thread support is implemented in a future version of
Emacs we'll get some parallel GC as well.
[-- Attachment #2: Type: text/html, Size: 1926 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Default history-length should be higher
2014-01-26 19:44 ` Eli Zaretskii
2014-01-26 20:19 ` Bozhidar Batsov
@ 2014-01-26 20:34 ` Óscar Fuentes
2014-01-26 21:16 ` Drew Adams
1 sibling, 1 reply; 16+ messages in thread
From: Óscar Fuentes @ 2014-01-26 20:34 UTC (permalink / raw)
To: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> Did you try that? If not, please do. In my experience, your
> suggestion has a downside: the GC indeed happens less frequently, but
> when it does, it takes an annoyingly long time. I find it easier to
> tolerate many GCs that run to completion in less than a second, than
> to have a few GCs that take several seconds each.
A bit of VC speleology showed this:
eb6a66b5 src/alloc.c (Richard M. Stallman 1995-07-19 03:39:43 +0000 6734) gc_cons_threshold = 100000 * sizeof (Lisp_Object);
So the current value of gc_cons_threshold comes from 1995. Today's
low-end machines are several times faster than high-end workstations at
that time.
So maybe it is worth experimenting with higher values. I'll do like
Bozhidar Batsov and set gc-cons-threshold to some large value and see
how it goes. I'm a flx user too.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Default history-length should be higher
2014-01-26 19:22 ` Bozhidar Batsov
2014-01-26 19:44 ` Eli Zaretskii
@ 2014-01-26 23:44 ` Trent W. Buck
2014-01-26 23:52 ` Stefan Monnier
2 siblings, 0 replies; 16+ messages in thread
From: Trent W. Buck @ 2014-01-26 23:44 UTC (permalink / raw)
To: emacs-devel
Bozhidar Batsov <bozhidar@batsov.com> writes:
> Setting it to something in between 10MB and 50MB seems much more
> reasonable to me.
I'd prefer a round number like 8MiB or 64MiB :-)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Default history-length should be higher
2014-01-26 19:22 ` Bozhidar Batsov
2014-01-26 19:44 ` Eli Zaretskii
2014-01-26 23:44 ` Trent W. Buck
@ 2014-01-26 23:52 ` Stefan Monnier
2 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2014-01-26 23:52 UTC (permalink / raw)
To: Bozhidar Batsov; +Cc: Michael Welsh Duggan, emacs-devel
> Code that creates a lot of objects would obviously be impacted
> significantly, since GC would be performed frequently.
C-h v gc- TAB will show you that gc-cons-threshold is only one part of
the story. As soon as the heap grows, gc-cons-percentage takes over.
I.e. by default, if your heap is 100MB big, GC will take place every
10MB (rather than every 0.8MB) of allocation.
Of course, maybe we should increase gc-cons-percentage. But part of the
reason for wanting frequent GCs is to try and mitigate the effects
of fragmentation. So, a higher gc-cons-threshold might speed up
initialization of `flx' but it might also cause your Emacs session to
use more VSZ and RSS, which will also tend to make each GC slower.
In reality for code that just allocates a large data-structure and not
much else, the best option is "never GC" (since every GC will just waste
time, since we only allocated but not freed anything), although clearly
in general this is not a good option.
In the case of `flx', maybe the best option is for it to let-bind
gc-cons-threshold around the code that "allocates without freeing".
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread