From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18875 invoked from network); 6 Oct 2022 06:11:52 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Oct 2022 06:11:52 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665036712; b=IkBnCX95QQKwpt1HusxxjNLu4/9t3XsJnlxPOUKpfXIeysMRjI08E8esP+bL84y1stcQlHZ8Gk 4TmKXb7sA4jNyenksCLkFK/FKANXTLg0TFqN84V/I8NQU/CtQ3nEz8jTIcaG6UbJGSEqgk/0E8 XO0xs7aNf5SBl5JbBSvbymhGJYlbOb8xzmS5JfmyVWPN1PLc+quB+eGHmoFoxp7KvG7RvB824Q MciTzJ+OB8hTONcJdRW6c1WaMmjVam3Rlxwh7T0IlnUUqOWcnrkPSe5kDjEOuDDlRqDSumx8I5 QdpkswSRfvuhI9umc0S579Zkq6DUbcJ8xcczxwWqfnEfjw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f54.google.com) smtp.remote-ip=209.85.218.54; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1665036712; bh=oekGkN+AltwEN8EbDECJaVR0NIbFcuLvViveZvL8SuM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=KKS+yBcWBBKH+Nw6cW0VjtRABfhAgwRl4YDEhDZeGXcooN0cyBwAApf4ifz0P/X5pXxx0BGLSj Js0ESd9sbpShPmowN/07iXwyP5tXF6AytcvNyzRD8B4o4VItN6GFGUS1fUDza/imHAdjrGJmjA UM8ACobwcrZu0ihuQ5tYyCEfdE6b2MNsEwJrZVzlZDqmEyL4+UICvrx37Q/XDH3ueOBiSdQeKv VumHyomQwik8es/z+8V1OnRBcisjCNQVJMY0UAQUyYeqyKZVYBq3SngWuvw/rbPvSMbGszUKbT ujQXZn3BVyhNwVmLdpoFiyizKAdAT9hclW8zrGUMpyDD3w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=nNeu5uCBQ9ikPjIYrADj1PczcyJLQoAq7bVGbEf/drc=; b=GcmUYjmix447hReDtDfygBUWRS CTx6sbDIOjSsqB85wl77rB/Hg2/P6zX6kKT1JjnYJnfecQh8/FsbSyR+IEizh5xyx9ik3NgP1K8qO rA8mCPuCmRE9hpYlNuDoLhDV/gVQYww0jJN55x2YxXJnSk1NeHad+n/ncYDHJ06Qo2RSSIIIDYGbc 5vOYRnIObc6EX8/V50SYS4UyHc8qnmj28nDnIv/1wkhYH68vtEIdTQmctoBkOME2ROIBk2e/0CIZ+ 7nOg5CkSvreXuklKEPg5vhVHmerZiVcQtqfa3NQ5i6iDNYYjuyHAbieEx/kVNAC+GpJHKMtkClVTC my5U8yQQ==; Received: from authenticated user by zero.zsh.org with local id 1ogK6p-000Psv-MD; Thu, 06 Oct 2022 06:11:51 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f54.google.com) smtp.remote-ip=209.85.218.54; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f54.google.com ([209.85.218.54]:43921) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ogK5v-000PBN-8J; Thu, 06 Oct 2022 06:10:56 +0000 Received: by mail-ej1-f54.google.com with SMTP id a2so2188076ejx.10 for ; Wed, 05 Oct 2022 23:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=nNeu5uCBQ9ikPjIYrADj1PczcyJLQoAq7bVGbEf/drc=; b=miPhQOa7DEu3iOKUgpSYYNHngnmOtLJjV8gG5Ujo25PNUHByiF60X1o3gJfO61hCT7 od4IB6ShUYgU1PjNha8o9Z0WadOoOFLTcFLB/xEMbv7ePxZcqlBGOFGHItydnHAqipWq H8sd+out7asnQ0JliLw0Pc9piKY8/KwoCPYRKA8tqJi6BQNu0EL0SSFgYDn3HEhJcguE UTxC0t9nhOLbJ6U4O9gAryT6+sgjOJiJOG6+q/rZmHhO3A/2D0M79vnT8Fa7FAit0xzF dL2D4XXdixwPhhCzL4esaPGTP918I0/Hs6VBs7Xirjegb+VwP7VdoUDCx0KmZ6XaB4O8 sc6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nNeu5uCBQ9ikPjIYrADj1PczcyJLQoAq7bVGbEf/drc=; b=JqIYC00nxl6rYOGdA+z6k3+Po1olqTa+7u1rVDSmdz3ZtTa9vV2mPmd74qFJLaR3F7 F8ah5+/6cY/h8pJFRGeD51cwH4uhZELWr7fwm9UmVdDF00LdZveu+dW7PSRRs6T0t3j2 9JLKewfSo7Zc1/rjiV4BsKB/LBO8nyVifLM1nOtxkEj+nOyaXD68ABlCHCx2Mf2NQuFx 6x1mK+volCCmQ1obbpr8hQswdYqebRr76k84PjHNpIDoUavaSyaxrJv9upepYcksyiio 20YCEWq8bVRJR3M5zBBzLaQSwTE3VMGfZo8UZw+OaZDrGKAk30lJlKXBrHgKBuHgOacL icyg== X-Gm-Message-State: ACrzQf1V1ERa5wf2kE8HqQh50QgelNDubxgMkkJsrtErsCQdmPQkkB9P LtFU7ya1RK+UZtotJPoRHVkQf2QqM5y9VSz6HqNwvQ== X-Google-Smtp-Source: AMsMyM5Ijr/Ohg+viH7tkkhWVllTMnDFVz8OfIbDIOB9yAg1MgMxF4GTWnR9GPS2iIHfiWM2fOvAb+cvMYa64WHhUz8= X-Received: by 2002:a17:906:8a46:b0:781:7171:74d0 with SMTP id gx6-20020a1709068a4600b00781717174d0mr2613814ejc.214.1665036654458; Wed, 05 Oct 2022 23:10:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Wed, 5 Oct 2022 23:10:43 -0700 Message-ID: Subject: Re: SSD-friendly history To: dominik.vogt@gmx.de, Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 28186 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Wed, Oct 5, 2022 at 4:19 PM Dominik Vogt wrote: > > Disk space is not an issue. So, if I set > > SAVEHIST=120000 > HISTSIZE=100000 > > Then only 100.000 lines are loaded when the shell starts? The shell will read all 120000 lines and keep the last (most recent) 100000 of them. So there's a slight startup speed penalty. > But how does this interact with duplicate handling, especially > with HIST_EXPIRE_DUPS_FIRST? Duplicate handling all happens on the in-memory history. This means anything that suppresses duplicates from the HISTFILE (such as HIST_SAVE_NO_DUPS) will end up reducing it to HISTSIZE lines even if SAVEHIST is larger. The doc thus recommends setting HISTSIZE larger than SAVEHIST in the case of HIST_EXPIRE_DUPS_FIRST so that you don't immediately begin discarding your saved history as commands are entered (which might be important if e.g. you use accept-and-infer-next-history a lot). However, if you use INC_APPEND_HISTORY, duplicates are removed from HISTFILE only when that file is rewritten (at SAVEHIST + 20% while the shell is incrementally appending, or at shell exit). So in that case having SAVEHIST larger than HISTSIZE can be useful. (These are details that didn't come up in an earlier zsh-workers thread about default values for SAVEHIST and HISTSIZE and whether/when it makes sense for them to differ.)