From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4934 invoked by alias); 19 Jun 2017 20:37:29 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41324 Received: (qmail 22064 invoked from network); 19 Jun 2017 20:37:29 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f171.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.217.171):SA:0(-1.0/5.0):. Processed in 0.913484 secs); 19 Jun 2017 20:37:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=zBPurzaUpF6gVGeZ5GkZERV5UMhS5x2UjdKkjiAhxoI=; b=ArvfKHbcxrI+os4yW+nu+hXuw+4MFSFWTCuNn7Dp8KilIo1FtyZOobkaM4JSq2vVxB Ma8lLbB96b/N/2y3vDan0DWckoX/cA7ZboVgxUPqMsBFv2ChaqWM/dsSgg9VV+vrr2Z6 aJpwo2pFNIT51j+laRZU+s94w75vMZroMKRqVUalXuaqYTK2kb1URKgMag1Mq6BzXI/B 6+5PF8qwI782wTzp/3MhpkxkFJDzMoeSMZet0KwCea07asOQ6e77D0ZBh+GI5n5vKZy6 jUG4h5XQVnMDRU6eLsYAw+be+GLZgWAcbsluL2bCHmiLSjOY/cCwSsUhF6NVw7yOYK7R wZ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=zBPurzaUpF6gVGeZ5GkZERV5UMhS5x2UjdKkjiAhxoI=; b=eCuNrH6+rP8+IYuID4YrxE72Wrk9WidDkGhBgoek9qIBtkKpitK9EGKxZXdYKL5wx6 rpWtutpi/p9MZAaZkJ8QxrmDo29AEpQXwCLKTj3vGY7qeiUtKdD/AeolQE2lr9PpjzEd /tWXufVWLpuIx65KHgOZxzspgaK+NH2RrHwWzy+7NqrfTGPHfBowFXqs9ZUup2xQz5qQ ANzxfMFQZdS5Bpe3YEM367zfJlcqWjVf7LD3w98GjVDjx/N8hSt7ULrHSMIKKPSlMm0+ jTEogo8y571yLVHre/WkizSigIOS7jW4nDCBS2zyuiPyNxbfvpAT372Eo63S1cc+yA2b Op/A== X-Gm-Message-State: AKS2vOzawA5Y4FL2TLV6va2jUDodSmdQajzbRgMo1XydRN+/oeQRHa1g f254gJ55hkezFl3elc4= X-Received: by 10.176.2.84 with SMTP id 78mr10979244uas.80.1497904641415; Mon, 19 Jun 2017 13:37:21 -0700 (PDT) From: Bart Schaefer Message-Id: <170619133812.ZM3422@torch.brasslantern.com> Date: Mon, 19 Jun 2017 13:38:12 -0700 In-Reply-To: <20170619202835.7f207185@ntlworld.com> Comments: In reply to Peter Stephenson "Re: Why sourcing a file is not faster than doing a loop with eval, zle -N" (Jun 19, 8:28pm) References: <20170619122413.GA9294@chaz.gmail.com> <170619083116.ZM17323__41722.0601499595$1497886320$gmane$org@torch.brasslantern.com> <20170619161601.GB9294@chaz.gmail.com> <20170619202835.7f207185@ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: Why sourcing a file is not faster than doing a loop with eval, zle -N MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Parsing 10,000 lines, each a colon-command followed by misc. text, and repeated 10 times. HEAD from git: Src/zsh -fs 0.31s user 1.24s system 94% cpu 1.634 total Src/zsh -fs 0.45s user 1.31s system 98% cpu 1.795 total Src/zsh -fs 0.39s user 1.41s system 95% cpu 1.877 total Src/zsh -fs 0.31s user 1.16s system 88% cpu 1.652 total Src/zsh -fs 0.43s user 1.33s system 94% cpu 1.854 total Src/zsh -fs 0.43s user 1.22s system 92% cpu 1.784 total Src/zsh -fs 0.37s user 1.32s system 91% cpu 1.848 total Src/zsh -fs 0.31s user 1.48s system 91% cpu 1.948 total Src/zsh -fs 0.42s user 1.37s system 92% cpu 1.926 total Src/zsh -fs 0.30s user 1.52s system 92% cpu 1.964 total Peter's patch: Src/zsh -fs 0.11s user 0.59s system 73% cpu 0.953 total Src/zsh -fs 0.10s user 0.54s system 68% cpu 0.940 total Src/zsh -fs 0.17s user 0.56s system 71% cpu 1.017 total Src/zsh -fs 0.19s user 0.58s system 79% cpu 0.969 total Src/zsh -fs 0.13s user 0.65s system 74% cpu 1.040 total Src/zsh -fs 0.05s user 0.65s system 74% cpu 0.945 total Src/zsh -fs 0.19s user 0.64s system 82% cpu 1.009 total Src/zsh -fs 0.18s user 0.59s system 81% cpu 0.944 total Src/zsh -fs 0.34s user 0.47s system 80% cpu 1.002 total Src/zsh -fs 0.35s user 0.52s system 89% cpu 0.971 total My "simpler" patch: Src/zsh -fs 0.17s user 0.79s system 85% cpu 1.119 total Src/zsh -fs 0.28s user 0.77s system 90% cpu 1.160 total Src/zsh -fs 0.19s user 0.82s system 88% cpu 1.146 total Src/zsh -fs 0.20s user 0.70s system 82% cpu 1.087 total Src/zsh -fs 0.20s user 0.65s system 84% cpu 1.011 total Src/zsh -fs 0.31s user 0.57s system 86% cpu 1.021 total Src/zsh -fs 0.22s user 0.72s system 81% cpu 1.148 total Src/zsh -fs 0.21s user 0.60s system 81% cpu 0.999 total Src/zsh -fs 0.19s user 0.63s system 78% cpu 1.046 total Src/zsh -fs 0.23s user 0.81s system 83% cpu 1.242 total The additional speedup in PWS's patch is probably due to fewer stdio function calls, and skip of the check for buffer overflow on every character read. I don't think the HAVE_FGETS + configure change is needed, there are already at least four places where we assume fgets() is available.