From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88027 invoked by alias); 8 Feb 2020 14:51:16 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 87996 invoked by uid 89); 8 Feb 2020 14:51:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=troubles, measures, limitation, HX-Languages-Length:4047 X-HELO: mail-lj1-f172.google.com Received: from mail-lj1-f172.google.com (HELO mail-lj1-f172.google.com) (209.85.208.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Feb 2020 14:51:10 +0000 Received: by mail-lj1-f172.google.com with SMTP id v17so2366302ljg.4 for ; Sat, 08 Feb 2020 06:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=6QPfUsdgqwLI8R8XuMS2j8dg3kUoz/PGSTthmaocpik=; b=nbVJbipE8tRSZcgtb/pkTmrBAk9LUu/8tRwE069c31iAE+liDYYXWwSrUP4k7jnUSZ P+WYH2fqFc52vWmVjsYucAeBuvjSA8SVBUAHzxBRTPOh1BdXMkeQlPK+GcKNUYl1SHIy 7vRjqo0xX2xImt0P+NA3F4UIh6nxcUD6NBtUVcrVSeCsVOj7EO/tHeZmIhxvlOhVCese 2cMDpD2hlipLV3XquN6tBMEo4NJdDkJhaEA2ll+FLGUcvUPMMpKJJTqpItQYYFUWL25l ilSMNaXo3N/iJdUhI9hIVdvgz7PjCHHDuLPHj84sUmaH51Aplwkb5xr38qIpiwTZgoch bg+A== MIME-Version: 1.0 From: Koichi Murase Date: Sat, 08 Feb 2020 14:51:00 -0000 Message-ID: Subject: Question on pseudo console and legacy console To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00065.txt.bz2 I have a question on the pseudo console mode and the legacy console mode. Question: Does it cause problems to set `disable_pcon' in the default value of the environment variable `CYGWIN'? When is the pseudo console mode recommended, and when can I use the legacy console mode? I noticed that the terminal emulators with the pseudo console mode is quite slower than with the legacy console mode, so I am thinking of setting `disable_pcon' by default if it does not cause problem. Background: * There are large performance differences of terminal emulators between the legacy and pseudo console modes. I show some test and results in my laptop as follows: For example, one can measure a performance of the terminal emulators by the following commands. It measures the processing time of the terminal for 1M lines. $ yes | head -1000000 > yes.txt $ time cat yes.txt The results with different terminals and different console modes are summarized below: urxvt ... legacy: 0.410s, pcon: 33.517s (~ 80x slower) (A) win ... legacy: 1.593s, pcon: 36.064s (~ 20x slower) (B) x11 ... legacy: 1.573s, pcon: 35.611s (~ 20x slower) (C) tty ... legacy: 1.614s, pcon: 35.129s (~ 20x slower) mintty ... legacy: 3.811s, pcon: 39.406s (~ 10x slower) xterm -j ... legacy: 39.809s, pcon: 1m2.237s (~ 1.5x slower) [ Note: `legacy' and `pcon' are the legacy and pseudo console modes, respectively. (A)--(C) are three different modes of the terminal that I wrote by myself and also I primarily use daily. When xterm is tested, the option -j is passed to explicitly turn off the smooth scrolling mode. ] This is the results for a specific computer, but the difference between legacy and pseudo console modes is clear. I think the reason why pseudo console is so slow is that it actually internally processes terminal sequences and constructs its terminal contents in backgrounds, which is completely redundant process when the user uses terminal emulators. And the background terminal is as slow as xterm, which is at least ten times slower than the other terminal emulators. * I understand that, with the pseudo console mode, the Cygwin console have more powerful terminal features compared to the legacy console mode. However, I do not usually use the console but another terminal emulator. Also the default Cygwin Terminal (which can be launched from the shortcut icon on desktop or in the start menu) is actually Mintty, so I believe most other people also use terminal emulators. Is there any reason to enable the pseudo console mode for all the programs including those which does not use the console window? For example, does the Cygwin PTY with the legacy console mode have some limitation which is not present with the pseudo console mode? Or, are there some problems caused by the legacy console mode? I thought maybe some Windows Command-Line application (based on Windows Console API) could have troubles with the legacy console mode, but with a quick check for `cmd' and `PowerShell' it appears to work in the terminal emulators with the legacy console mode though I haven't tested it thoroughly. * For these reasons, if there is no functional differences between the pseudo console mode and the legacy console mode as far as I use terminal emulators, I tend to think about setting `disable_pcon' as the default value of the environment variable `CYGWIN'. But looking at the discussion at https://cygwin.com/ml/cygwin-patches/2020-q1/threads.html#00060 it appears the setting `disable_pcon' is only introduced as a workaround for the programs incompatible with the pseudo console mode (such as `cgdb'), and the pseudo console mode is still considered to be appropriate for normal programs. * If the console mode would not cause any differences when there is no visible console window, would it make sense to change Cygwin's behavior so that it switches to the pseudo console mode only when the console window is present (if it is not too difficult technically)? Best regards, Koichi -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple