mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 09:48:05 +03:00
e7a89e8c45
Summary: Use a dedicated Span type so we can enforce reverse ordering and `start <= end` directly on the Span structure. The constructor of `SpanSet` becomes more expensive because it recreates the `Vec`, and sorts it. Practically, hopefully it's fine. Internal logic like union will not use that constructor. Some comments and tweaks have been made to make the code easier to read. There are some performance changes, though: Before: intersection 5.030 ms union 5.920 ms difference 4.804 ms After: intersection 6.036 ms union 5.426 ms difference 4.710 ms `intersection` becomes slower, while `union` and `difference` become a bit faster. Hopefully the regression is within the acceptable range. Reviewed By: sfilipco Differential Revision: D15023651 fbshipit-source-id: ea7845d5d20faf204cfb85c66fc3bd6e25c9fc0c |
||
---|---|---|
.. | ||
argparse | ||
asyncrevisionstore/src | ||
bookmarkstore | ||
cdatapack | ||
clib | ||
commitcloudsubscriber | ||
configparser | ||
cpython-ext | ||
cpython-failure | ||
dag | ||
edenapi | ||
encoding | ||
hg_watchman_client | ||
hgpython | ||
indexedlog | ||
linelog | ||
lz4-pyframe | ||
manifest | ||
minibench | ||
mpatch | ||
mpatch-sys | ||
mutationstore | ||
nodemap | ||
pathmatcher | ||
radixbuf | ||
revisionstore | ||
third-party | ||
treestate | ||
types | ||
url-ext | ||
vlqencoding | ||
watchman_client | ||
zstdelta | ||
Cargo.toml | ||
README.md |
lib
Any native code (C/C++/Rust) that Mercurial (either core or extensions)
depends on should go here. Python code, or native code that depends on
Python code (e.g. #include <Python.h>
or use cpython
) is disallowed.
As we start to convert more of Mercurial into Rust, and write new paths entrirely in native code, we'll want to limit our dependency on Python, which is why this barrier exists.
See also hgext/extlib/README.md
, mercurial/cext/README.mb
.
How do I choose between lib
and extlib
(and cext
)?
If your code is native and doesn't depend on Python (awesome!), it goes here.
Otherwise, put it in hgext/extlib
(if it's only used by extensions) or
mercurial/cext
(if it's used by extensions or core).