[PATCH] Increase performance on Windows by up to 2x

Stefan Rusek stefan at rusek.org
Fri Mar 27 04:54:23 CDT 2009


This patch fails to properly clean up handle, fd, and fp in the case
of an error.

Also, Windows buffers all file IO unless explicitly told not to while
opening a file (using the FILE_FLAG_NO_BUFFERING flag). I would guess
that the real reason for the speed up is that python either has its
own python object based buffering layer, or it does not release and
reacquire GIL for synchronous file IO.

2009/3/26 Bryan O'Sullivan <bos at serpentine.com>:
> This patch replaces the util_win32 module's posixfile_nt class with a C
> wrapper that lets Mercurial use Python's normal file handling code. That
> code uses buffered I/O for reads and writes, so is substantially faster in
> many cases than the existing code which goes through the win32 I/O APIs. In
> case the C extension is not available, we still fall back to the current
> code.
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
>


More information about the Mercurial-devel mailing list