Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: One glob (*cbp) slow, other (*1000) fast, why?
- X-seq: zsh-users 21850
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: One glob (*cbp) slow, other (*1000) fast, why?
- Date: Thu, 8 Sep 2016 11:06:04 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ht5zihjk+d/EwQ9695sABLwiEDAw9+g0X6eB0lfu7I4=; b=A+4PswfmKvaVUshjPs+IBcJv5XJb+fbh1OMo2y+GMMikbJoM4WUpCoxuxcgwEvjmok sppRksCeRGn0cNbhIHSuHxxJoCobDD7lZXgpEMD4TFOcahbwe8mtsJLBctPUu1unYzlW WJBhjUgBSJrUy9fg5KUyqH16RlNR0LfotTwnMJcGwzuFs+79nDtsGzR4t1BF4uy2fF2h VEbK8bgttro98h2Ao+0cYidzrrB7/6obXbzISasocjmmIRmW3aA2vDoslb3jzvwnq6oo Zc/hB2Lr0BQmOxjnGsdaB0Z/AkbxaUoTjrKEUimOqFWOhU0Cvsu+ZZ84C0itOWdzuZSa i+UA==
- In-reply-to: <CAKc7PVCX0zW_bXncdrjZ37nQ4NtYHPpbP6AgCaZxm=gV7F6GuA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCX0zW_bXncdrjZ37nQ4NtYHPpbP6AgCaZxm=gV7F6GuA@mail.gmail.com>
Ah, it's obvious, I've forgot what NY1 does, returns after first match.. :)
Best regards,
Sebastian Gniazdowski
On 8 September 2016 at 10:47, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
wrote:
> 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
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author