##// END OF EJS Templates
rust-status: add bare `hg status` support in hg-core...
rust-status: add bare `hg status` support in hg-core A lot of performance remains to be gained, most notably by doing more things in parallel, but also by caching, not falling back to Python but switching to another regex engine, etc.. I have measured on multiple repositories that this change, when in combination with the next two patches, improve bare `hg status` performance, and has no observable impact when falling back (because it does so early). On the Netbeans repository: C: 840ms Rust+C: 556ms Mozilla Central with the one pattern that causes a fallback removed: C: 2.315s Rust+C: 1.700 s Differential Revision: https://phab.mercurial-scm.org/D7929

File last commit:

r44085:53607fd3 stable
r45015:c8891bca default
Show More
bdiffbuild.py
36 lines | 757 B | text/x-python | PythonLexer
from __future__ import absolute_import
import cffi
import os
ffi = cffi.FFI()
with open(
os.path.join(os.path.join(os.path.dirname(__file__), '..'), 'bdiff.c')
) as f:
ffi.set_source(
"mercurial.cffi._bdiff", f.read(), include_dirs=['mercurial']
)
ffi.cdef(
"""
struct bdiff_line {
int hash, n, e;
ssize_t len;
const char *l;
};
struct bdiff_hunk;
struct bdiff_hunk {
int a1, a2, b1, b2;
struct bdiff_hunk *next;
};
int bdiff_splitlines(const char *a, ssize_t len, struct bdiff_line **lr);
int bdiff_diff(struct bdiff_line *a, int an, struct bdiff_line *b, int bn,
struct bdiff_hunk *base);
void bdiff_freehunks(struct bdiff_hunk *l);
void free(void*);
"""
)
if __name__ == '__main__':
ffi.compile()