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.0 required=5.0 tests=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 ccf1a5b3 for ; Thu, 26 Dec 2019 11:30:00 +0000 (UTC) Received: (qmail 18352 invoked by alias); 26 Dec 2019 11:29:53 -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: 45145 Received: (qmail 4023 invoked by uid 1010); 26 Dec 2019 11:29:53 -0000 X-Qmail-Scanner-Diagnostics: from out5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25670. spamassassin: 3.4.2. Clear:RC:0(66.111.4.29):SA:0(-2.6/5.0):. Processed in 4.856132 secs); 26 Dec 2019 11:29:53 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddviedgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtgfesth hqredtreerjeenucfhrhhomhepfdffrghnihgvlhcuufhhrghhrghffdcuoegurdhssegu rghnihgvlhdrshhhrghhrghfrdhnrghmvgeqnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgenucevlhhushhtvghrufhiiigv pedt X-ME-Proxy: X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-694-gd5bab98-fmstable-20191218v1 Mime-Version: 1.0 Message-Id: In-Reply-To: <027d3c24-e3d1-4cfd-8c3e-5221998a327f@www.fastmail.com> References: <20191223222436.rtsmhs4xuug2jfum@localhost> <20191224202327.or5yuftjieyq5z2o@tarpaulin.shahaf.local2> <8CB7B64F-BFB9-49C9-ACDD-AA60D58873E2@dana.is> <027d3c24-e3d1-4cfd-8c3e-5221998a327f@www.fastmail.com> Date: Thu, 26 Dec 2019 11:28:50 +0000 From: "Daniel Shahaf" To: zsh-workers@zsh.org Subject: Re: [BUG] zformat -f has no multibyte support Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Daniel Shahaf wrote on Thu, 26 Dec 2019 05:04 +00:00: > dana wrote on Thu, 26 Dec 2019 04:35 +00:00: > > On 24 Dec 2019, at 14:23, Daniel Shahaf wro= te: > > > Actually, I don't suppose we could just call into the printf code = directly, can > > > we? It _works_ (see attachment), but it's not elegant. > >=20 > > A very quick before/after test shows that it reduces performance qui= te a bit, > > especially as the number of format specs increases. Admittedly, it's= only a > > few =C2=B5s per spec in absolute numbers (at least on my Mac, with t= he handful of > > operations i tested), >=20 > What is the _factor_ of slowdown? (Multiplicative, as opposed to addi= tive) > I.e., does the patch make things slower by 1%, or 10%, or 100%, or 100= 0%? According to dana and I's results, the factor is between x4 and x29: [[[ % for 1 in */Src/zsh; do printf "%-16s%s\n" $1:h:h $($1 -fc 'time ( zfor= mat -f x ${(r.1000000..%a.):-} a:o )'); done ( zformat -f x ${(r.1000000..%a.):-} a:o; ) 0.10s user 0.27s system 99%= cpu 0.369 total master =20 ( zformat -f x ${(r.1000000..%a.):-} a:o; ) 1.04s user 0.33s system 99%= cpu 1.372 total patch =20 ]]] [[[ # Without patch [DEV] zsh % repeat 5 utime zformat -f x ${(r.10000..%a.):-} a:o [429 =C2=B5s] [507 =C2=B5s] [499 =C2=B5s] [468 =C2=B5s] [609 =C2=B5s] # With patch [DEV] zsh % repeat 5 utime zformat -f x ${(r.10000..%a.):-} a:o [16577 =C2=B5s] [14063 =C2=B5s] [13941 =C2=B5s] [13972 =C2=B5s] [13569 =C2=B5s] ]]] I don't know how to explain the difference (we've both had other things = to look into).