From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 bbb73d30 for ; Sun, 11 Aug 2019 19:21:03 +0000 (UTC) Received: (qmail 16573 invoked by alias); 11 Aug 2019 19:20:59 -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: 44650 Received: (qmail 9607 invoked by uid 1010); 11 Aug 2019 19:20:59 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f43.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25538. spamassassin: 3.4.2. Clear:RC:0(209.85.217.43):SA:0(-2.0/5.0):. Processed in 3.350988 secs); 11 Aug 2019 19:20:59 -0000 X-Envelope-From: sgniazdowski@gmail.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.43 as permitted sender) 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 :cc:content-transfer-encoding; bh=di9SStDBJg+bHJ1Wj0yqqxADRLr2k7yDww+ZWWkoitI=; b=azkvt2Kzj9MGcdr/ltXEN5PNlz7Tyertk/QjkexWkMD0+GA0+9VCpeOPPNOZdr6Xeq S2u5O1CTA8jJOjlY2mxM1dhBiTbN6icPTjz0zoB/MH4Ck1cI5GyiqOS6caR8dqnZ5arL TdppLiHMkWKn2Q/lA/x9MHMf4wm1s8nhIgQqXOZ5nlJTL+fMS6vvXFwsgNpqCqBW9CpB MrtlotcYnnYkXrbARdqbU1c9kFb/s7RQ9FXnhXTIQdoLVPAidTd+p9V+3Ul7NozX++/c W14zLhbdgN4//zr1iUPKe7AiTDrEMpplPIhubLKk84V6Okk/cemJuLAuauc1hRnYhq36 ugmA== 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:cc:content-transfer-encoding; bh=di9SStDBJg+bHJ1Wj0yqqxADRLr2k7yDww+ZWWkoitI=; b=ujVl/m5pDj7OVRaKel4ZCWQavBht3uX5nsCIW/3KxwwO80QEpJDrrKbchwUtugfePb HAQnM33Axx8z9McCMZuabBU1bUZHJlk2KL0Tn2d2ooYpkeGllaqSjRa/yrEN1luc8XxM L9qkrvubJqDwdRHlSIdeuB6FSdBbD13uFOCW2KvFArQ4vckOpvzO/huOXamzuL4qTPmq v3oZJc+wD63/f4Dmmo0KvUZ+pn1ETpBYNyMTVZUt042eYFl+S2QqCX/j8nUjUGJ27Hg6 KV1fk3lwaBJQVSqCISP9Wt/PRJttuUsuklJRFTgPcKHtLQSLjyfl+cguywp1OKXoyaOT lpog== X-Gm-Message-State: APjAAAV8t0+w5UgtFFtknuPbbyUCq3fcd+1PvmH9W2W0Hoq5TaTt978q 7AQPlrB+e8AirEhn/Z72XC0yhnohb7Kp9TQ3mUZAQHUJyEI= X-Google-Smtp-Source: APXvYqy1NLrHRd6Q0oLJ6d8opVUmFN+h0sSUG2TaVOePHQOgpO+1aCobq65KcPgieUhHN9Pe6dgr+785LByQWfMaMMI= X-Received: by 2002:a67:80c8:: with SMTP id b191mr19441955vsd.113.1565551222725; Sun, 11 Aug 2019 12:20:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Sun, 11 Aug 2019 21:20:11 +0200 Message-ID: Subject: Re: Optimizing (z)-flag To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 11 Aug 2019 at 20:37, Bart Schaefer wro= te: > You're going to want to look at bufferwords in Src/hist.c. If memory > allocation is the problem (of which I'm not convinced) it's probably > ... Yeah, it does things properly =E2=80=93 via a linked list. So appends are fast. At the end it converts the list into an array via: aval =3D hlinklist2array(list, 0); which does things properly too. I'm not sure why I've had the impression that (z) is somewhat slow, for a zshrc with 20001 characters it runs in: ( a=3D(${(z)buff}) ; ) 0,00s user 0,00s system 83% cpu 0,005 total which is a very good time. It was probably when I was optimizing fast-syntax-highlighting and a time like 100 ms seemed large. --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org