##// END OF EJS Templates
util: improve iterfile so it chooses code path wisely...
util: improve iterfile so it chooses code path wisely We have performance concerns on "iterfile" as it is 4X slower on normal files. While modern systems have the nice property that reading a "fast" (on-disk) file cannot be interrupted and should be made use of. This patch dumps the related knowledge in comments. And "iterfile" chooses code paths wisely: 1. If it's CPython 3, or PyPY, use the fast path. 2. If fp is a normal file, use the fast path. 3. If fp is not a normal file and CPython version >= 2.7.4, use the same workaround (4x slower) as before. 4. If fp is not a normal file and CPython version < 2.7.4, use another workaround (2x slower but may block longer then necessary) which basically re-invents the buffer + readline logic in Python. This will give us good confidence on both correctness and performance dealing with EINTR in iterfile(fp) for all known supported Python versions.

File last commit:

r25603:1cac419a default
r30418:1156ec81 default
Show More
filelog.tmpl
29 lines | 1.4 KiB | application/x-cheetah | CheetahLexer
{header}
<title>{repo|escape}: {file|escape} history</title>
<link rel="alternate" type="application/atom+xml"
href="{url|urlescape}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}">
<link rel="alternate" type="application/rss+xml"
href="{url|urlescape}rss-log/tip/{file|urlescape}" title="RSS feed for {repo|escape}:{file}">
</head>
<body>
<div class="buttons">
<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a>
<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
<a href="{url|urlescape}file/{symrev}/{file|urlescape}{sessionvars%urlparameter}">file</a>
<a href="{url|urlescape}annotate/{symrev}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
<a type="application/rss+xml" href="{url|urlescape}rss-log/tip/{file|urlescape}">rss</a>
<a type="application/atom+xml" href="{url|urlescape}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}">atom</a>
</div>
<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / {file|escape} revision history</h2>
<p>navigate: <small class="navigate">{nav%filenav}</small></p>
{entries%filelogentry}
{footer}