delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/12/22/00:58:41

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5BM5wf1L024525
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 5BM5wf1L024525
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=GFm4pHNo
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94AE84BA2E04
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1766383120;
bh=Z5SauDwP4Uo+so6ae48cw+9IhrbjF1jLeXEz4pAVpiY=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=GFm4pHNo8LM+PkjcW1SVYUjvscDzGaC7VtrPFTsHQY80AXBMtmshFbG64DPoNssD+
FCiR2GjbXp7rnkSogMmM77JV9JhYuExE0m1dDus1+XaT+Vf8IUQiSpkzUn/P4pKw7A
2JK3/YNC2JLQ3cqoGFAd8xKE5A4PQS8evs8FOyjc=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AD2F4BA2E05
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6AD2F4BA2E05
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1766383102; cv=none;
b=JFgNBzCfsya6pHrQKRIh5eZ2wd+/MvDQ0hhbfEZdZihyGxXofFP2SSpxa/l/5nxi621yJhjGj3mJ4KtcK9CmGAR63kuerTcpw8SJD5fZ0vM1FdJSOYNnD4K+kSkshqq6WRgyZrEVBddpu/bZ3fWeY6xmkm1dm/UAwzLGXKnu1JM=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1766383102; c=relaxed/simple;
bh=DncUCC5xxqYltaG3QgnBj0E81sKgChceqZvfFuk8BJo=;
h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From;
b=Y63K5xu6cJdBeiTAbkei/NWv/SF4KMJxUhTNYGL/f73Crn1i+nZA5Fy/yd6gk9vhAvyJcjPJjFxNXVVdJNPygbKAxAjhGXKxM+x7EgmM9sbZ6UGVVN0c4VQWgbkJzmufn+NMajpWdu8lg+2C2JUWHhvdSnHbIfO/+lyK0y2YOEw=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AD2F4BA2E05
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1766383101; x=1766987901;
h=content-transfer-encoding:in-reply-to:from:references:to
:content-language:subject:user-agent:mime-version:date:message-id
:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=UYhGQCmXQO0nZRNv19akzPp/xKZiXidUYKyNzhSo6jw=;
b=MWFcrqLBFrMSL2g25kK2IoovRBH2d+MPqbqtraRUAw4ZfXBrQi4+BqTyFPguJzEc4a
ZN3Ztxj6rqaKeBJ2QT7lHEPcwSZij9KpU0xypJlNI8W9TJnr+lHlAOnMZzE4T7QuuLD5
ZGBpJ6Q0+FKpaKFG5ZnB0nWmzTvapV306uoNWEZMXQyzDlEk0O2LmJm+CWGfmw8bZXwU
SGAoHpOn8gzEFwI6EB4PiVxgChmbDSbZNsPcqNN1+34KLtNCVlpdyf/4rCuvulDsGJzo
wpC9IVkku1zc18HDL2qtOM6lcyjY/4+B1XiKqyn7BraE/EJ6593C/pFUmnIcZN3NZDU9
C16w==
X-Gm-Message-State: AOJu0YxaE1vK2rwOyxRvlxQrh+pjXD//LhyRbOAlydPQLL2jdqnsHE2J
jEPfAvv/sjqIkVWvO5F6WG6K6NMIlmZOiypukMaRq5fKPIzGISNm/Yd4i70YaTvA
X-Gm-Gg: AY/fxX4DirSh2PV013Y9oYiL1cwrO39sJA27Ejc2At4T8oMCO/269DYowoowBi+/Nwq
FjsB1t9dUn5t1yrJsGwa+WL9YhO9cBmgrv3pw3VKaMZZkCB/3iiYyRIIXe5wTa7IMNV9wSxCApd
Cjkf7Ro+frE0A964rutlIlYzViE1nMZ4cr/sdIXkM0krgQ4tg18KaQFDMqij5+nsO6v3C9Ofh45
ekYefdYfdj+/Bjf0HesN2gpIsEYorieqmRIWODdVtKtNXO8jbRZOb4oq4MLgpobOJ8UeKT8MOQk
IaAoD3BS4l7jMFUiM6OhXR3RTNwSysdZZSMjrp2eZdf1MsLTe+JX0bjNJsL01IW3XhaM5LXVzRG
4UaYx8NkWraCfIZwg+uJ6D+gImMxxLenT7qQqSzOF+QyLvyfD14zbqCFTmPnQjplIlNZV9yi/TM
kShYt0bAXfy9SU9K31TRBtEoSmfEl9UnAaUeFYb9L4EXw4LeOrrmuJbFbiPJ3ZB0WjL4fE
X-Google-Smtp-Source: AGHT+IFen251hOfO1Wxrc9ZqaWBIObBGXo52XR4MUD3Y91ZLknclbw37XskcyciEBVTekjOaD+uGMA==
X-Received: by 2002:a05:600c:a016:b0:477:5c45:8100 with SMTP id
5b1f17b1804b1-47d19594e57mr96332705e9.24.1766383101245;
Sun, 21 Dec 2025 21:58:21 -0800 (PST)
Message-ID: <5f1fb088-7f4b-4858-87b7-e1d89f5c7334@gmail.com>
Date: Mon, 22 Dec 2025 06:58:20 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Why is stat slow?
To: cygwin AT cygwin DOT com
References: <74bdc787-9099-8e29-492a-588546b6eedb AT cs DOT umass DOT edu>
In-Reply-To: <74bdc787-9099-8e29-492a-588546b6eedb@cs.umass.edu>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Marco Atzeri via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Marco Atzeri <marco DOT atzeri AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 5BM5wf1L024525

On 22/12/2025 06:15, Eliot Moss via Cygwin wrote:
> Dear Cygwin-ers --
> 
> 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
> 
> (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 <the files> gives
> 
> real    2m12.425s
> user    0m0.249s
> sys     0m1.312s
> 
> A second run shortly after the first completes very quickly, indicating the
> presence of a cache :-) .
> 
> time stat <the files> on WSL2 gives:
> 
> real    0m2.208s
> user    0m0.026s
> sys     0m0.149s
> 
> This is after a reboot, so there is no caching available.  So, why is 
> Cygwin
> 60 times slower, even when WSL2 has the handicap of having to work 
> through the
> 9p adapter / COM surrogate?
> 
> Mostly I am curious, but this is also relevant because I rsync this file
> collection to offsite storage, and the stat time is about what it takes for
> rsync to start up - it needs to check file times and lengths.
> 
> This makes me wonder if there is something we can do to make this 
> better, by
> figuring out what WSL2 / 9p are doing ...
> 
> Best - Eliot Moss
> 

I do not notice a slow run.
The disk is an external 1T USB3 hard disk

$ time stat /dev/sdb1
   File: /dev/sdb1
   Size: 0               Blocks: 0          IO Block: 65536  block 
special file
Device: 8,17    Inode: 524305      Links: 1     Device type: 8,17
Access: (0666/brw-rw-rw-)  Uid: (197608/   Marco)   Gid: (197121/ NESSUNO)
Access: 2025-12-22 06:55:21.968106000 +0100
Modify: 2025-12-22 06:55:21.968106000 +0100
Change: 2025-12-22 06:55:21.968106000 +0100
  Birth: 2025-12-22 06:55:21.968106000 +0100

real    0m0.099s
user    0m0.030s
sys     0m0.000s

$ time stat /cygdrive/d
   File: /cygdrive/d
   Size: 0               Blocks: 8          IO Block: 65536  directory
Device: 54787,64366     Inode: 1407374883553285  Links: 1
Access: (0770/drwxrwx---)  Uid: (   18/  SYSTEM)   Gid: (   18/  SYSTEM)
Access: 2025-12-21 19:40:02.793348100 +0100
Modify: 2025-11-11 15:18:10.162456400 +0100
Change: 2025-11-11 15:18:10.162456400 +0100
  Birth: 2018-04-11 15:14:25.158842400 +0200

real    0m0.028s
user    0m0.015s
sys     0m0.000s

Regards
Marco

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019