zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Performance tests of quoting and dequoting, printf -v turned out slow
Date: Sun, 11 Mar 2018 00:33:46 -0800	[thread overview]
Message-ID: <CAH+w=7Z0_O2Fke5j2M3z28vfJGREyNuEcf1Fybjuh-nHRxWHYg@mail.gmail.com> (raw)
In-Reply-To: <19380.1520696454@thecus>

On Sat, Mar 10, 2018 at 7:40 AM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
>
> What may affect things is whether or not zsh was built to use
> open_memstream from libc. FreeBSD and GNU libc have open_memstream.

Indeed:

schaefer[556] Src/zsh -f
% qflag() {
    local OUTPUT
    repeat 10000; do
        OUTPUT="${(q)INPUT}"
    done
}
% typeset -F SECONDS=0; qflag; print $SECONDS
0.0282280000
% prtf() {
    local OUTPUT
    repeat 10000; do
        printf -v OUTPUT '%q ' "$INPUT"
    done
}
% typeset -F SECONDS=0; prtf; print $SECONDS
3.8363050000
%

schaefer[557] grep -i memstream config.h
/* Define to 1 if you have the `open_memstream' function. */
/* #undef HAVE_OPEN_MEMSTREAM */


  reply	other threads:[~2018-03-11  8:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09  6:22 Sebastian Gniazdowski
2018-03-09 13:23 ` Stephane Chazelas
     [not found] ` <etPan.5aa28b1e.77e79f33.159ee@AirmailxGenerated.am>
2018-03-09 13:39   ` Sebastian Gniazdowski
2018-03-09 14:53     ` Stephane Chazelas
2018-03-10  8:36       ` Sebastian Gniazdowski
2018-03-10 15:03         ` Stephane Chazelas
     [not found]         ` <etPan.5aa3f656.1efba338.159ee@AirmailxGenerated.am>
2018-03-10 16:53           ` Sebastian Gniazdowski
2018-03-10 15:40 ` Oliver Kiddle
2018-03-11  8:33   ` Bart Schaefer [this message]
2018-03-13 11:28     ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7Z0_O2Fke5j2M3z28vfJGREyNuEcf1Fybjuh-nHRxWHYg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).