##// 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.
Jun Wu -
r30418:1156ec81 default
Show More
Name Size Modified Last Commit Author
/ mercurial / templates / spartan
branches.tmpl Loading ...
changelog.tmpl Loading ...
changelogentry.tmpl Loading ...
changeset.tmpl Loading ...
error.tmpl Loading ...
fileannotate.tmpl Loading ...
filediff.tmpl Loading ...
filelog.tmpl Loading ...
filelogentry.tmpl Loading ...
filerevision.tmpl Loading ...
footer.tmpl Loading ...
graph.tmpl Loading ...
header.tmpl Loading ...
index.tmpl Loading ...
manifest.tmpl Loading ...
map Loading ...
notfound.tmpl Loading ...
search.tmpl Loading ...
shortlog.tmpl Loading ...
shortlogentry.tmpl Loading ...
tags.tmpl Loading ...