zsh-users
 help / color / mirror / code / Atom feed
From: sergio <sergio@outerface.net>
To: zsh-users@zsh.org
Subject: why is (F) about twice as fast as print -l ?
Date: Mon, 6 Feb 2023 08:15:25 +0400	[thread overview]
Message-ID: <e0c80c2f-313a-8412-83b2-973c0800e60e@outerface.net> (raw)


l=({1..100000000})

% for i in {1..3}; do time (print ${(F)l} > /dev/null); done
( print ${(F)l} > /dev/null; )  12.08s user 0.35s system 99% cpu 12.473 
total
( print ${(F)l} > /dev/null; )  11.89s user 0.35s system 99% cpu 12.283 
total
( print ${(F)l} > /dev/null; )  11.99s user 0.37s system 99% cpu 12.414 
total

% for i in {1..3}; do time (print -l $l > /dev/null); done
( print -l $l > /dev/null; )  22.11s user 2.90s system 99% cpu 25.044 total
( print -l $l > /dev/null; )  22.00s user 3.12s system 99% cpu 25.160 total
( print -l $l > /dev/null; )  22.15s user 3.01s system 99% cpu 25.216 total


-- 
sergio.


             reply	other threads:[~2023-02-06  4:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  4:15 sergio [this message]
2023-02-06  5:03 ` Bart Schaefer

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=e0c80c2f-313a-8412-83b2-973c0800e60e@outerface.net \
    --to=sergio@outerface.net \
    --cc=zsh-users@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).