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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29833 invoked from network); 30 Nov 2021 08:11:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Nov 2021 08:11:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1638259865; b=WxT3quldkbnDnOkm7lQubmKY3HAgjszu9+nBhpt3Zgk3Ona2UhMEsXR9yENiKAG8qQD8eThmdy V4IDG18THxLrXvE+mxEi6zGGbw8DVenMgzpk5yQ5EtJC/j5aArBU3nmbpXeQd1Si64XXRMfCiH 4SZ4fE1fAvtOYqJua1nzTN7LjpR5O3g8gyrmqisfINfHlulo8uRzjpwmZmDbgf5zDiHvH8z7zi Zyp1O+d09A2XzSOVutgDxYEZrbgWoFZpDNMb9aPljGCNr/T6G7ybvaXvWb57pyjvSiQRnSt6Un mUmi23wr6lAtzISoN093ERZendO0F+Xh33JZOLaev22dVQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ua1-f47.google.com) smtp.remote-ip=209.85.222.47; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1638259865; bh=bww6fCSPpstrUQ2Ry0yuFooaMjkHk0a4yLTdvpO6mk0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:References: In-Reply-To:MIME-Version:DKIM-Signature:DKIM-Signature; b=n4d6vD2JtU79cMrbd2khAlskrkxOPEdVkkGto7nDeWK4INmCWkeKb+GyLeEkUPdUaHynYXyhRq 7u4ZAWbQSvfS2EuzjdouxSvQB6fzdXALAQAEmmuHmiT0fmoLIknfMQ5N6HALnsJ9wYgVmS+WAA TyKp+a5pjEHd9wr+pUiMpEIee2RkQnnPVK1FrXnY+/A3Ohz28NESDqxttLsx+sEOPXKFP+yL5L MhEGl0UkH87NShHLIVKgIah5wxYE29MDBkZfmMHImrZbaaT4qit2UtahzAIonlld8mga5/rw30 HI+RJwT/9/10NjLsIzbnUSfui+mIO2BXytkKxNMyfw4umw==; 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:Cc:To:Subject:Message-ID :Date:From:References:In-Reply-To:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=9h+AS4uqT0+IppJI2kFHEDOCgmQVdq8pmzuq7Je6bQg=; b=WtvbFafqGMDeQJyxRhnZeFYl18 +hPvFILn/W2C3pYlWTV4OPaMPTye1oNYjPRs/guifqO3815fjbEpbAgLsOZDQvlaY1C5Kn4YOaUkH RwVc9FyMUNrvnU57GOHTngL0PbEBAY2hZbVzgqdIcLLeU56f9WkLYrZFKe1qgfcQqykug1QG+Ug4L ebeI0JG/Hg1nsKjVOMTlUtWtBoe9xN82ip4N1qz69olq46JfBKxpSLmAzAH2ClZQL0nQj+mXFoEg2 A4wHQMpo9SIDxU0xLPmrH3FxqIZnKMWirtDLf7y+LhshvQP4ByR7kZiBXcrRnxKsaxZaaoO3rR7Ad dvJT6m2A==; Received: from authenticated user by zero.zsh.org with local id 1mryEC-0009z3-O4; Tue, 30 Nov 2021 08:11:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ua1-f47.google.com) smtp.remote-ip=209.85.222.47; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ua1-f47.google.com ([209.85.222.47]:45680) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mryDa-0009Gj-Ct; Tue, 30 Nov 2021 08:10:26 +0000 Received: by mail-ua1-f47.google.com with SMTP id ay21so39639429uab.12 for ; Tue, 30 Nov 2021 00:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9h+AS4uqT0+IppJI2kFHEDOCgmQVdq8pmzuq7Je6bQg=; b=e8kxlfMcFz3XKQiWQpwhotQRtTMP6Cz9S/Xo7K0FuQ7ubBuPiB0BNXARSCRCbhXUQI vkdrU+WtxQz0QyrWxIDrOlBtqC2OIwtMiJxcSlukeU2sd1T0ihC/JgGpaKl+UoSL5f92 JdGxFk19rdMUiJ3y6grUyuEJ6aeKsMGWOl6PC+J7FoyxfLdKkI8hmz65hM47XPn1EaJO 03sNWunm5zo5xtIfZMbpmMEcTBPoX8f5ioB6igmtp4wdT3s3a+X5Q3lO72x7U6wDVQgA rkey9LBsUhyimV/LEmqnAKpzJDdgZa8oM6FQLFBzq5WsnuBK0jd7XVO8OX5RAdOZtzIF 9yOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9h+AS4uqT0+IppJI2kFHEDOCgmQVdq8pmzuq7Je6bQg=; b=yYE5jcoxQWiEpnu6ktH6tVFzlvyM5zFu0HfdxESo4O/6C5quVtnKoX0Bu58QsFnd9R yhZvQL//S5GmJIln0naxvZ9sNmDLBfuYHNlQ6KBQghDuEv4Iz8rathhOiaIYpTHkn2mT kULkIGFonjz9d6KGNyXqyn8H69VNP9DsT4sJxhX3zzbKKlduBZfqLyPtr/mM/KkaB/OG wRCDTptcJjcysyqNTX2kutdUC0ueJ4wks7tiv2kudfQBsQlaS5YoPZmWe6x4Zc1KKqOm BB26Ds8SfFUKJIfc0ch44ELQvtSVnsjfQWIWXL7OhXxWYG+WsuYvEh0jEpe41/RevqGe EWNQ== X-Gm-Message-State: AOAM531YJZvOnt6tmaPigkSQiIhFcm0G7ZdZORxTgBYhng5KV6qngm5t xxogZgrI5WTPibfJ7k5nzinzw6gBaIjWuZ3OjyQ= X-Google-Smtp-Source: ABdhPJzCBWjPbBqf5yx7ha/WSbSaQL3ix5XdAKXxHxM3dRZ2LVeYx2oGNCvLfNcIf2YzkspPrvS9eZVddHKUvFhtVDg= X-Received: by 2002:a67:f9cf:: with SMTP id c15mr38565664vsq.74.1638259825416; Tue, 30 Nov 2021 00:10:25 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ab0:2a82:0:0:0:0:0 with HTTP; Tue, 30 Nov 2021 00:10:24 -0800 (PST) In-Reply-To: References: From: Mikael Magnusson Date: Tue, 30 Nov 2021 09:10:24 +0100 Message-ID: Subject: Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits To: Roman Perepelitsa Cc: Zach Riggle , Bart Schaefer , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27395 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 11/30/21, Roman Perepelitsa wrote: > On Tue, Nov 30, 2021 at 3:30 AM Zach Riggle wrote: >> >> The benchmark I used >> >> $ hyperfine 'zsh -i -l "exit 0"' >> >> >> Obviously this is not the BEST benchmark [for checking shell startup >> time] > > Obviously. It's the worst or at least a strong contender for the title. I think it's fine to do this (assuming he actually meant -i -l -c "exit 0" (missing -c in the quoted command)), if you don't do any weird stuff in your startup files (like you mention in your "how not to benchmark" section). Assuming your startup files are synchronous, the above will tell you how long it takes to execute your init file plus some other overhead, so if you do something and the number is lower, the thing you did will indeed make startup faster. If your startup files are not synchronous, then obviously nothing I said applies and everything you say is true. BTW, the above command can easily be improved for worseness: % time (repeat 1000; zsh -ic exit) > Since you care about interactive zsh performance, at least skim > through the homepage of zsh-bench. It'll save you time. % ./zsh-bench ==> benchmarking login shell of mikaelh ... zsh-bench: cannot find prompt; make sure it contains hostname or the last part of the current directory Sadly no time was saved :(. -- Mikael Magnusson