From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43696-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 2fad7389 for ; Tue, 16 Oct 2018 22:24:52 +0000 (UTC) Received: (qmail 25632 invoked by alias); 16 Oct 2018 22:24:41 -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: List-Unsubscribe: X-Seq: 43696 Received: (qmail 24242 invoked by uid 1010); 16 Oct 2018 22:24:41 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f66.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.210.66):SA:0(-1.9/5.0):. Processed in 1.573598 secs); 16 Oct 2018 22:24:41 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=XCIRoNRu3wEd57emIfRjvMYRIIF5p80pOUCcP1odfz4=; b=f2J6m6d9eWbEjBfjROOhruw9u+XfYvBSvNRkfR0D2ixDQK/v0vAUThwl70PNyAxGuV MrYt+tRX6PsTAVZ36MUQMlyi871dOHS57R+gtwyn9kLgxRxbRTz1f5YqyBcaushtQxJH +qztJf83TEXOi42rX7+evv+p0fZCzgpwhL+9zjEyCJIDbx5Xw+eJAqlYE5HwZce0xa/L DNu/6SrjyfRnaOqEAT4tkNq2NPjBo2Z2hWkYDvrTRWMdWxghaMC4Y/4crH1Ion2wcNHO 4tSSZ2wTJOdWR0wfAZ1I9X50pUsd2tVdh5R/3IIFvZmqdTVaLIkM3N3ULJj0PeA0vd9e ffgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=XCIRoNRu3wEd57emIfRjvMYRIIF5p80pOUCcP1odfz4=; b=KLJog55gpI08Bdl6nBLOT52Ey9SQRGH7URbR/gZbRK6bH3j1qL2C5Y/F9ob8RRkYnn ZzEzf/+nvgndD1WJfRZS+SxViastNAHCjkgbQcbZ0MUhqk2I3i54F7ysGn/+ImSalLeb X8n04wE2LuMn7I7RKAx5kcLGVQQLdmFGJAkBVFrg7X/1wQVmrANcum8+fhNsOl6G8act 5JzK0RYk8hkq7wzazoztSUf6MW3UjHNrDOeHHB+Fs8z7kVennUIUKK9kNkcrBayJlUNO jCDSbHSOd2I2iG8j43DTr6Vdk/sYsrgBcfPTUVjEljVIpWKfItA4MnTPGbDFBA/tEkRL wvsA== X-Gm-Message-State: ABuFfog6rLlFMcvH5s7nEA/eKJzK2gqbM/T7ZdqMC4WROgoMnTs6Ih1A Kdlk0QpRvbPzlh/0RJGYY2FH6+wCQ3gL2wfHbl5Rlg== X-Google-Smtp-Source: ACcGV61OyyWn/QDLM98BxChybVb819bnkr+KXZUz3Xi8DYO4LMb0Oiw107PpOSPIcDQuIY/ea/FxkUvI+lhsr/uG4SQ= X-Received: by 2002:a9d:3b24:: with SMTP id z33-v6mr8808665otb.126.1539728676726; Tue, 16 Oct 2018 15:24:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Wed, 17 Oct 2018 00:24:24 +0200 Message-ID: Subject: Re: [PATCH] Clean but not very effective optimization (lex.c / dupstring_wlen) To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable PS. I've run the F-Sy-H test via callgrind, twice, and in both runs there is a drop in total instruction count, of 12.3 mln or 13 mln, out of the total instruction count being 7.3 bilion. The lesser count is of course for the optimized Zsh. On Wed, 17 Oct 2018 at 00:08, Sebastian Gniazdowski wrote: > > Hello, > dupstring_wlen (i.e. with-len) is ready to use, so this patch is just > 4 changes dupstring(s) -> dupstring_wlen(s, l). Each of those > dupstrings has a nice strlen() invocation already there in lex.c, a > few lines above. > > Callgrind doesn't report any real change in number of instructions of > strlen() call and a test that repeatedly invokes (z) flag on a 32-line > buffer 150 times reports 24 ms for both unoptimized and optimized > version. > > However performance test of F-Sy-Highlighting reports rather stable 40 > ms gain =E2=80=93 out of ~3000 ms, so not much. > > In general simplicity of this patch made me send it. > > -- > Sebastian Gniazdowski > News: https://twitter.com/ZdharmaI > IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin > Blog: http://zdharma.org --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org