zsh-workers
 help / color / mirror / code / Atom feed
From: Anand N <anand.mail@gmail.com>
To: zsh-workers@zsh.org
Subject: Issue with echo & source to /dev/stdin
Date: Wed, 6 Jan 2021 11:57:05 +0530	[thread overview]
Message-ID: <CAH=D2ePLkLKt=SuA6B=23VMKZwx68cLw=HCogWG+mcM-UfyYyw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

Hi All,

My zsh has become very slow after upgrading to Mac Big Sur OS.
It was nvm that was causing the issue. So I researched and found that nvm
can be lazy loaded with the `--no-use` option.

However, even after using --no-use, it was still slow. The reason is a
simple echo command to /dev/stdin. It is taking >5 seconds. Below are the
lines that are causing the issue

```
[ "_$( . /dev/stdin yes 2> /dev/null <<'EOF'
[ $# -gt 0 ] && nvm_echo $1
EOF
)" = "_yes" ]
```

We noticed that even a very basic echo to /dev/stdin is taking more than 5
seconds. For example

```

time ((echo abc) | (. /dev/stdin))

/dev/stdin:1: command not found: abc
( ( echo abc; ) | ( . /dev/stdin; ); )  0.00s user 0.00s system 0% cpu
5.087 total

```

This happens only with shell built-in echo and doesn't happen with
/bin/echo.
We tried many options and a more detailed discussion can be found in the
below github issue
https://github.com/nvm-sh/nvm/issues/2387

Looking forward to your help. You can directly reply in the github thread.
It will help others as well.

Thanks,
Anand

[-- Attachment #2: Type: text/html, Size: 4241 bytes --]

             reply	other threads:[~2021-01-06  6:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  6:27 Anand N [this message]
2021-01-06 16:40 ` Bart Schaefer
     [not found]   ` <CAH=D2ePreSUi9VSDqZsXVjAJZbte5ui5c60BMvERRK4gCiZnbA@mail.gmail.com>
2021-01-06 17:10     ` Fwd: " Anand N
2021-01-06 20:41       ` Bart Schaefer
2021-01-06 16:48 ` 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='CAH=D2ePLkLKt=SuA6B=23VMKZwx68cLw=HCogWG+mcM-UfyYyw@mail.gmail.com' \
    --to=anand.mail@gmail.com \
    --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).