bug-bash
[Top][All Lists]
Advanced

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

Re: Slow history load with some values of HISTSIZE


From: alex xmb sw ratchev
Subject: Re: Slow history load with some values of HISTSIZE
Date: Tue, 6 Feb 2024 05:10:41 +0100

there is also a possible value of -1 , for unlimited
i had once a ~3mb or ~7mb file cause some bug .. and it took ( too ) long
to load

greets

On Tue, Feb 6, 2024, 05:07 Casey Johnson <strykre@hotmail.com> wrote:

> That is more or less how I happened upon this behavior. I have been using
> bash for 20+ years and for most of that time I have had HISTSIZE and
> HISTFILESIZE large enough to be effectively unlimited. I recently took the
> time to learn the difference between HISTSIZE and HISTFILESIZE. I liked the
> idea of having a perpetual history (unlimited HISTFILESIZE) but only
> keeping the most recent entries in memory by default, since those are the
> most likely ones I would want to reuse. If I really want to mine the old
> entries on occasion, I can always bump up HISTSIZE and load the whole file.
> I think I started with something like HISTSIZE=25000 and was surprised by
> how long new terminals took to produce the first prompt. I started playing
> around with different values and it wasn't hard to guess that there was a
> whole lot of memmove() (or similar) happening.
> ------------------------------
> *From:* alex xmb sw ratchev <fxmbsw7@gmail.com>
> *Sent:* Monday, February 5, 2024 7:29 PM
> *To:* Dale R. Worley <worley@alum.mit.edu>
> *Cc:* Casey Johnson <strykre@hotmail.com>; bug-bash <bug-bash@gnu.org>
> *Subject:* Re: Slow history load with some values of HISTSIZE
>
>
>
> On Mon, Feb 5, 2024, 18:09 Dale R. Worley <worley@alum.mit.edu> wrote:
>
> Casey Johnson <strykre@hotmail.com> writes:
> >     In a clean shell, execute:
> >             HISTFILE=alt-history.txt
> >             HISTSIZE=150000
> >             history -r
> >     and then observe how long the last command runs before returning.
>
> Though I expect that when you exit bash, the history file gets trimmed
> to 150,000 lines, and then the "over 10 seconds to load" doesn't happen
> again.
>
>
> there is another HISTFILESIZE var
> maybe ..
>
> Dale
>
>


reply via email to

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