Zsh Mailing List Archive
Messages sorted by:
Re: delay in exitting from zsh shell
- X-seq: zsh-users 16569
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: delay in exitting from zsh shell
- Date: Thu, 10 Nov 2011 02:10:07 -0800
- In-reply-to: <20111110071946.GA2380@devbox>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20111109222020.GB10120@devbox> <111109195118.ZM6411@torch.brasslantern.com> <20111110071946.GA2380@devbox>
On Nov 10, 9:19am, Eugene Dzhurinsky wrote:
} Okay, I wrote stupid and simple program to de-duplicate lines in
} history file:
You can't compare that to what zsh is doing. The history file isn't
just duplicate lines, it's duplicate shell parser constructs which
may span multiple lines. The only way to _correctly_ deduplicate it
is to run it through the parser while loading it; that's where all
the time/CPU is going.
} Am I missing something there if would say that history saving and
} de-duplication is suboptimal?
If a special routine that does nothing but deduplicate the file were
to be added, it could probably be faster, yes. The history mechanism
performs the deduplication by loading the file back in roughly as if
all the commands were being typed at the command line again, so that
the behavior of deduplication exactly reproduces what the shell would
have done interactively with all the setopts that are in effect.
This is simply not an operation that's done often enough -- nor is
having 10000+ lines of shared deduplicated history a common enough user
configuration -- for anyone to have undertaken to create an efficient
deduplication routine that nevertheless faithfully reproduces the
behavior of re-parsing the file. Feel free to contribute that ...
However, it might be simpler just to unset the options that cause the
file to be deduped on shell exit, and e.g. allow it to be deduped on
shell startup instead.
Messages sorted by: