DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5BMF7fsX959593 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 5BMF7fsX959593 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=BqeNdqiH X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07FE84BA2E2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1766416061; bh=ZgM9VwA66uf5ux5WLXiSpzGyAgV40c9XViWlFjVWksQ=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BqeNdqiHklzmYB0purc58MzugrD+zEdC/yr6NIGgs22CSc6kPiqEnEDQL7Zn03DyE rIeq81CtqVZoLohVRNlNOUYdORKtUdqoALoWjQHUz4hgtbQhhqug7DopL2XS7m77m7 OmE7Cd/h6JXHiRJHhE4SW2+Js1Tz1NiFVxBeLKqo= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 606784BA2E04 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 606784BA2E04 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1766416042; cv=none; b=B9uY9TLWIgdWUK1S2GK6kuKQ/rUUR9DN/YObFKTsIC4eHvZeFBe8tjhYMo0PJ3Uc7VnUeLT83QPXgwAs+pLjuKgXxcdz8gjpvoHPGybo5pCkBHBYP1Y/p/P3n+QYZdR2ozKofpHJpC4fDp39UIKEfznZYIEE/rEdGxLP+RKJ1fM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1766416042; c=relaxed/simple; bh=xwpjpHxQNxxTf6UE0ePpxrM4CDIllJqNjJfS5T5yJ0U=; h=Subject:To:From:Message-ID:Date:MIME-Version; b=Io763J7vVJrLZlgXz+s+1iTbIYJVfnj4RgYUt31tP5JlsXxywme4uz1uqcHVcMwnuKZ9V8pNxMUPykemHO2PWbJyey6Q3VSOp3cw8A3AGzri5BdX22PTE98SBTpI4OytDDPvxEW92Cxxm6IFYG5KusWua5VIWbaTEafezw1saiM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 606784BA2E04 Subject: Re: Why is stat slow? To: cygwin AT cygwin DOT com References: <74bdc787-9099-8e29-492a-588546b6eedb AT cs DOT umass DOT edu> Message-ID: Date: Mon, 22 Dec 2025 16:07:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 SeaMonkey/2.53.22 MIME-Version: 1.0 In-Reply-To: <74bdc787-9099-8e29-492a-588546b6eedb@cs.umass.edu> X-TOI-EXPURGATEID: 150726::1766416032-3B7D0553-63649910/0/0 CLEAN NORMAL X-TOI-MSGID: 19a770fa-c03d-4ccd-8607-89b6a9d1f2e6 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christian Franke via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Christian Franke Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 5BMF7fsX959593 Eliot Moss via Cygwin wrote: > I'm sure this has been asked before, more than once, but I am again > wondering > what, specifically, makes stat (the program, but presumably also the > syscall) > substantially slower on Cygwin compared to stat on WSL2.  I am talking > about > an external HDD (not solid state) on my D: drive.  It shows under WSL > 2 as > /mnt/d like this (output of mount): > > D:\ on /mnt/d type 9p > (rw,noatime,aname=drvfs;path=D:\;uid=0;gid=0;symlinkroot=/mnt/,cache=5,access=client,msize=65536,trans=fd,rfd=5,wfd=5) > > On Cygwin it shows up like this (yes, mount shows two lines): > > D: on /cygdrive/d type ntfs (binary,notexec,posix=0,user) > D: on /cygdrive/d type ntfs (binary,noacl,posix=0,user,noumount,auto) > > My /etc/fstab lines are: > > none /cygdrive cygdrive binary,noacl,posix=0,user 0 0 > d: /cygdrive/d ntfs binary,posix=0,user,auto,notexec 0 0 In the past, Cygwin did not support individual options for some /cygdrive/X. If this is still the case, "noacl" without "notexec" is effective for /cygdrive/d. Then Cygwin reads the header of each file to check for a possible "x" permission. > > (Presumably this has something to do with two mounts showing ...) > > On D; I have a folder with hundreds of 2Gb files (they are backups, > split into > 2Gb portions).  On Cygwin > > time stat gives > > real    2m12.425s > user    0m0.249s > sys     0m1.312s > This would explain this long duration. Quick test: $ echo '#!/bin/sh' > /cygdrive/d/script.tmp $ ls -l /cygdrive/d/script.tmp -rwxr-xr-x .... <== notexec unset -rw-r--r-- .... <== notexec set -- Regards, Christian -- 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