X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16C8F3873CD3
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1670492906;
	bh=R4g3BONYBDHaVxZkEBmFPGcmJdxyEUKQ3fkYqmYbEQo=;
	h=Date:To:Cc:Subject:In-Reply-To:References:List-Id:
	 List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
	 From:Reply-To:From;
	b=GU2uvM8jF83Sr7b/9ZtPCsQ6u6ACR8E1dzLJAfOp886HI0+8oA1X70scwmnhyaaPf
	 NDzD4eRqva44o8gXCNLPIhNtgYn6z8b8CWc3bNrA7CXgwE6XbYDnIOTAZJeuP92+uF
	 Xj7UMKQ7asprNHca+dLWqnn2Fe3fl7z9REJJkIOA=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A30A384092F
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 2B89ktZl001501
X-Nifty-SrcIP: [220.150.135.41]
Date: Thu, 8 Dec 2022 18:46:56 +0900
To: cygwin@cygwin.com
Cc: tryandbuy <tryandbuy@proton.me>
Subject: Re: Performance regression in cygwin 3.4.0
Message-Id: <20221208184656.ea6b9796eccc503c1e238f0f@nifty.ne.jp>
In-Reply-To: <Abw9_BgkZRll8zEaAWSNVO1Uw0sF_--Amd02G5fpj3r5O6QBhyqjWu2cxV1IctJtM03OGztfZx60TEIYfDi34p3_unluAxKgQDzcsYZASxY=@proton.me>
References: <Abw9_BgkZRll8zEaAWSNVO1Uw0sF_--Amd02G5fpj3r5O6QBhyqjWu2cxV1IctJtM03OGztfZx60TEIYfDi34p3_unluAxKgQDzcsYZASxY=@proton.me>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, NICE_REPLY_A,
 RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin@cygwin.com>
Reply-To: Takashi Yano <takashi.yano@nifty.ne.jp>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

On Wed, 07 Dec 2022 19:38:19 +0000
tryandbuy wrote:
> Reading from stdin is very slow when a process runs outside of Cygwin Terminal.
> 
> Steps to reproduce:
> 1. Create "test.txt" file using python code:
> long_text = "10" * 2500
> with open(r'test.txt', 'w') as f:
>     for i in range(5000):
>         f.write('KEY%03d: %d => %s\n' % (i % 100, i, long_text))
> 
> 2. Install "cygwin" package version > "3.3.6-1"
> 3. Open windows command prompt (cmd.exe)
> 4. Enter command:
> type test.txt | c:\cygwin64\bin\wc.exe -l
> 
> When running the same command (use cat instead of type) on the Cygwin Terminal, no performance issues observed.
> 
> The last version of cygwin package without issues: 3.3.6-1
> Versions of cygwin package with issues: 3.4.x - 3.5.x
> 
> P.S. I tested this combinations of pipings:
> cygwin_prog | win_prog    # no issues
> win_prog | cygwin_prog    # has issues when running in windows command prompt, no issues in Cygwin Terminal
> cygwin_prog | cygwin_prog # has issues  when running in windows command prompt, no issues in Cygwin Terminal

I confirmed the problem. I also identified the code difference,
which causes the problem, between cygwin 3.3.x and 3.4.0.

Let us consider how to fix that.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
