This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.7.0 CVS mmap failure

On Thu, Jan 18, 2007 at 06:18:52PM +0100, Corinna Vinschen wrote:
> > Right, it's an optimization problem rather than a bug.  Patches
> > welcome, but I've put it on my TODO list, too.
> I have applied a patch to CVS which calls fstat early, at the spot where
> GetFileSize got called so far.  The stat structure is then propagated to
> subsequent function calls and used there.  This should reduce the fstat
> calls to exactly one per file based mmap call.  All my testcases still
> work fine, but we already saw that my testcases don't cover all weird
> cases in the world.  So, please give this change a serious test.

Thanks for fixing this. I also noticed these when reading through the code.
Another area for extremely small optimization is to just cache the pagesize.
I notice a *lot* of calls to getpagesize(), when I can't really see the
pagesize changing within a single call to mmap(). Since the map implementations
appear to use a data object for tracking/management, it should be pretty
easy to add a psz size_t/DWORD/whatever to it.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]