[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Slow history load with some values of HISTSIZE
From: |
Casey Johnson |
Subject: |
Re: Slow history load with some values of HISTSIZE |
Date: |
Tue, 6 Feb 2024 04:07:55 +0000 |
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<mailto:worley@alum.mit.edu>> wrote:
Casey Johnson <strykre@hotmail.com<mailto: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