Mail Archives: cygwin/2007/01/19/10:42:00
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.
-cl
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -