mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
A Scalable, User-Friendly Source Control System.
15fe9250df
Summary: Pre-import modules so when they are imported by `extensions.py`, they will get a cache hit. Note: use a dict explicitly since it's much faster than re-`import`: In [2]: %timeit import hgext.rebase The slowest run took 13.43 times longer than the fastest. This could mean that an intermediate result is being cached. 1000000 loops, best of 3: 444 ns per loop In [3]: d=sys.modules In [4]: %timeit d['hgext.rebase'] 10000000 loops, best of 3: 38 ns per loop In [7]: %timeit sys.modules['hgext.rebase'] The slowest run took 31.89 times longer than the fastest. This could mean that an intermediate result is being cached. 10000000 loops, best of 3: 67.3 ns per loop Even importing two modules and constructing a tuple is 2.5x faster than directly "import" one module: In [8]: %timeit (sys.modules['hgext.rebase'], sys.modules['hgext.absorb']) The slowest run took 10.78 times longer than the fastest. This could mean that an intermediate result is being cached. 10000000 loops, best of 3: 177 ns per loop Reviewed By: singhsrb Differential Revision: D7840236 fbshipit-source-id: ca351c61ec63ffdaf401e561944e97963b434b3c |
||
---|---|---|
.cargo | ||
contrib | ||
distutils_rust | ||
doc | ||
hgdemandimport | ||
hgext | ||
hgext3rd | ||
hgsubversion | ||
i18n | ||
lib | ||
lz4revlog | ||
mercurial | ||
tests | ||
.clang-format | ||
.editorconfig | ||
.flake8 | ||
.gitignore | ||
.hg-vendored-crates | ||
.hgsigs | ||
.jshintrc | ||
.watchmanconfig | ||
CONTRIBUTING | ||
CONTRIBUTORS | ||
COPYING | ||
hg | ||
hgeditor | ||
hgweb.cgi | ||
Makefile | ||
README.rst | ||
setup.py |
Mercurial ========= Mercurial is a fast, easy to use, distributed revision control tool for software developers. Basic install:: $ make # see install targets $ make install # do a system-wide install $ hg debuginstall # sanity-check setup $ hg # see help Running without installing:: $ make local # build for inplace usage $ ./hg --version # should show the latest version See https://mercurial-scm.org/ for detailed installation instructions, platform-specific notes, and Mercurial user information.