X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 770EB3858034 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.umass.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=moss AT cs DOT umass DOT edu Subject: Re: Cygwin fork performance followup To: Hamish McIntyre-Bhatty , Cygwin General Mailing List References: From: Eliot Moss Message-ID: <2b4429db-ab6f-b40a-a1f2-2a8db91e8f88@cs.umass.edu> Date: Thu, 4 Feb 2021 09:44:30 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: moss AT cs DOT umass DOT edu Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" On 2/4/2021 9:29 AM, Hamish McIntyre-Bhatty via Cygwin wrote: > Hi all, > > I managed to improve my Cygwin VM's performance significantly using a > variety of methods. > > If anyone else is experiencing troubles, seeing what I changed at > https://www.hamishmb.com/blog/improving-cygwins-performance-fork/ might > also help you. Not using VirtualBox was the main improvement for me (now > using KVM/QEMU). Note that I didn't achieve much difference, but that > was because my system is relatively powerful. What isn't shown is that > these changes do seem to help with the fork speed drop-off that occurs > over time. Yes, fork can be a bottleneck in Cygwin. I do wonder if we might get some improvement for a lot of common cases if spawn were used more, in favor of fork, and Cygwin supported "fast paths" for the simpler cases of spawn, to where the libraries in the child process would not need to be loaded in the same place. More complex cases of spawn could fall back to a fork-based approach underneath. The idea is to grab some low hanging fruit - if there is any. What I don't know is whether such fruit can be had. For example, does bash use spawn, and if so, does it use calls that could be optimized in this way? I don't know. Likewise other tools that do lost of forking might need to be inspected, such as 'make'. I seem to recall this was discussed some before ... Best wishes - Eliot -- 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