From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: One glob (*cbp) slow, other (*1000) fast, why?
Date: Thu, 8 Sep 2016 10:47:48 +0200 [thread overview]
Message-ID: <CAKc7PVCX0zW_bXncdrjZ37nQ4NtYHPpbP6AgCaZxm=gV7F6GuA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 689 bytes --]
Hello,
on a directory with 80000 files (result of touch {1..2000} {1..2000}{a..c})
I do:
typeset -F SECONDS; myst=$SECONDS; tmp=( *cbp(NY1) ); echo $(( (SECONDS -
myst) * 1000 ))
it returns: 80.449999999927968
then I do:
typeset -F SECONDS; myst=$SECONDS; tmp=( *1000(NY1) ); echo $(( (SECONDS -
myst) * 1000 ))
it returns: 0.15299999995477265
Why such a difference?
More:
typeset -F SECONDS; myst=$SECONDS; tmp=( *10000(NY1) ); echo $(( (SECONDS -
myst) * 1000 ))
0.2779999999802385
typeset -F SECONDS; myst=$SECONDS; tmp=( *100000(NY1) ); echo $(( (SECONDS
- myst) * 1000 ))
78.060000000277796
I.e. it starts to be slow at 5 or more zeros.
Best regards,
Sebastian Gniazdowski
next reply other threads:[~2016-09-08 10:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-08 8:47 Sebastian Gniazdowski [this message]
2016-09-08 9:06 ` 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='CAKc7PVCX0zW_bXncdrjZ37nQ4NtYHPpbP6AgCaZxm=gV7F6GuA@mail.gmail.com' \
--to=sgniazdowski@gmail.com \
--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).