[PATCH] osutil: introduce a posixfile type for Unix

Idan Kamara idankk86 at gmail.com
Thu Apr 12 16:36:51 CDT 2012


On Fri, Apr 13, 2012 at 12:06 AM, Bryan O'Sullivan <bos at serpentine.com>wrote:

> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1334264798 25200
> # Node ID 231bfc0704e37b0eea300fc1a4ada302171de394
> # Parent  0057f7b2f0671ae10622be34cf6cde0aa3848a80
> osutil: introduce a posixfile type for Unix
>
> This improves general file performance by about 10% compared to
> Python's native file type.  The main improvement comes from bypassing
> stdio and using Unix system calls directly.  A smaller additional
> effect is due to (by default) not allowing other Python threads to
> run during potentially blocking system calls, on the assumption
> that hg is a single-threaded app.


All these performance improvements are pretty neat but you have to
wonder whether the shift to C and the inevitable code complexity they
introduce are worth it in the long run.

Maybe they all are. But it's also worth thinking about so we don't end
up with a big part of Mercurial that no one wants to go near.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120413/2cdbf261/attachment.html>


More information about the Mercurial-devel mailing list