This is the mail archive of the
mailing list for the Cygwin project.
Re: Cygwin Filesystem Performance degradation 1.7.5 vs 1.7.7, and methods for improving performance
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-developers at cygwin dot com
- Date: Mon, 4 Oct 2010 12:23:31 +0200
- Subject: Re: Cygwin Filesystem Performance degradation 1.7.5 vs 1.7.7, and methods for improving performance
- References: <20100922134412.GA4817@ednor.casa.cgf.cx> <4CA20212.firstname.lastname@example.org> <20100928151032.GA30911@trixie.casa.cgf.cx> <4CA2298F.email@example.com> <AANLkTikjWJj+cjZTfjyTkCjTuHbcpt7AWf2KsEkAkYhT@mail.gmail.com> <20100929083201.GB4861@calimero.vinschen.de> <4CA30205.firstname.lastname@example.org> <4CA8AC31.email@example.com> <20101003195307.GB5480@calimero.vinschen.de> <4CA8F6C0.firstname.lastname@example.org>
- Reply-to: cygwin-developers at cygwin dot com
On Oct 3 23:33, Derry Shribman wrote:
> > I'm missing a comparison using the latest Cygwin from CVS. That's
> > much more interesting than 1.7.5.
> All the comparisons where done BOTH on 1.7.5 AND on 1.7.7!
> Here are the 1.7.7 results again:
I saw the numbers for 1.7.7 but I was talking about current CVS. Due to
Yoni's mail to cygwin-patches I already changed quite a few things. A
comparison should take the latest incarnation of the code into account
since, obviously, development is going into this direction.
> Could you compile and run it and report the results on your PCs?
Compile the latest Cygwin from CVS and do the comparison on the machines
you already used. What sense does it make to add YA machine with
different hardware? Especially since all my Windows machines except for
a single netbook are running in VMs.
> > You also never replied to my mail describing the suffix problem when
> > using the NtQueryDirectoryFile function:
> > http://cygwin.com/ml/cygwin-patches/2010-q3/msg00073.html
> Yoni was busy with preparing the stat performance test program, so I
> will answer this one:
> Calling NtQueryDirectoryFile() is implemented in the kernel by
> IRP_MJ_DIRECTORY_CONTROL, and RestartScan is flags |=
> SL_RESTART_SCAN, ReturnSingleEntry is flags |=
> What is missing is being able to set flags |= SL_INDEX_SPECIFIED
> when calling from user-mode.
The WDK description does not say that SL_INDEX_SPECIFIED provides
this functionality and it also specifies that using the FileIndex
does not make any sense on NTFS. Which in turn makes sense, given
that NTFS keeps directories always in name sorted order.
> So - as you wrote: This means that NtQueryDirectoryFile() should be
> called with a 'fresh' handle every time.
> Thats why in the performance test application Yoni wrote, a new
> handle was called for every NtQueryDirectoryFile() - so that this
> was taken into account.
That's not really the same. The test application does not take .lnk and
.exe suffixes into account. It just stats what it already got from a
former readdir. My private test within the Cygwin code itself was not
as positive and in fact slowed down `ls -l' since now there was YA
handle to open. But anyway. Maybe the method using a filter with
wildcards is a winner.
> We have NOD32 anti-virus installed on all XP PCs at our work place.
> So that may probably be one of the reasons for the XP slowdown. Can
> you run the test program on an XP at your place and see how results
Well, I can try, but it's a VM, too.
> > However, it's easy to make a speed comparsion which ignores the bunch of
> > problems Cygwin is fighting against. What about the problems of various
> > filesystems, for instance?
> Cygwin anyway today caches the volume type. So it can know whether
> it is NTFS/FAT without a system call.
No, not really. You can make this point for the drive which hosts the
systemroot, but every other drive (or junction) can change at any given
> > This requires at least one open handle to the volume to be sure to have
> > the right filesystem type. So, whatever you do, you need to open a
> > handle first. Either to the parent dir or to the file. This is kind of
> > a chicken-egg problem.
> This is exactly what Yoni cached in the patch he submitted to cygwin-patches!
I didn't look into the patch for the well-known reason. The description
in Yoni's mail implies that the caching is based on the path, just like
in 1.5.x. That's correct only in an environment which you control
yourself, but it's not necessarily correct for any other environment.
That's why I added a new caching algorithm to current CVS which is based
on the results of a single FileFsVolumeInformation result. This still
requires an open handle, either of the file itself, or of it's parent
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com