zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: delay in exitting from zsh shell
Date: Wed, 09 Nov 2011 19:51:18 -0800	[thread overview]
Message-ID: <111109195118.ZM6411@torch.brasslantern.com> (raw)
In-Reply-To: <20111109222020.GB10120@devbox>

On Nov 10, 12:20am, Eugene Dzhurinsky wrote:
}
} Hello, I'm facing the strange issue - when I run zsh shell and eventually try
} to exit from it - it takes some time (3-5 seconds) between I hit Ctrl+D or
} type "exit" in shell prompt.
} 
} After some experiments I realized that if I remove .histfile - then
} ZSH exists immediately, as supposed.

This tends to imply that what's taking those 3-5 seconds is searching
your history file for duplicate entries in order to enforce the
hist_save_no_dups option.  Also, inc_append_history may allow the file
to grow to up to 10500 lines for a SAVEHIST of 10000, and those extra
lines will be trimmed at shell exit.

In more detail, when you use inc_append_history and/or share_history
along with hist_save_no_dups, zsh re-reads and de-duplicates the entire
file from disk after it has obtained a lock for it, rather than just
dumping out the history that is already in memory, because it can't
know if some other shell has appended something new to the file before
the lock was obtained.  The speed of the disk is inconsequential to the
CPU expended doing the deduplication.


  parent reply	other threads:[~2011-11-10  3:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 22:20 Eugene Dzhurinsky
2011-11-10  1:14 ` Rommel Martinez
2011-11-10  6:56   ` Eugene Dzhurinsky
2011-11-10  3:51 ` Bart Schaefer [this message]
2011-11-10  7:19   ` Eugene Dzhurinsky
2011-11-10 10:10     ` Bart Schaefer
2011-11-10 10:15       ` Eugene Dzhurinsky
2011-11-10 10:46         ` Bart Schaefer
2011-11-10 10:58           ` Eugene Dzhurinsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=111109195118.ZM6411@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).