mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
20dfef4801
Summary: The SpanSet can include a large amount of revs. Iterating through it by putting everything in a PyList is suboptimal. Therefore add a dedicated native iterator for it. This speeds up iteration greatly, which can be verified via debugshell: Before: In [1]: s=m.smartset.spansset(b.dag.spans(xrange(5000000))) In [2]: %time s.slice(0,10) CPU times: user 135 ms, sys: 42.9 ms, total: 178 ms Wall time: 180 ms After: In [1]: s=m.smartset.spansset(b.dag.spans(xrange(5000000))) In [2]: %time s.slice(0,10) CPU times: user 49 µs, sys: 6 µs, total: 55 µs Wall time: 58.2 µs Reviewed By: sfilipco Differential Revision: D17305350 fbshipit-source-id: 0db00aa57fb6bf2141ccea94b2536da78f103cef |
||
---|---|---|
.. | ||
asyncrevisionstore/src | ||
blackbox | ||
bookmarkstore | ||
cdatapack | ||
clib | ||
clidispatch | ||
cliparser | ||
commitcloudsubscriber | ||
commitstore/bench-serialize | ||
configparser | ||
cpython-ext | ||
cpython-failure | ||
dag | ||
drawdag | ||
edenapi | ||
encoding | ||
hg_watchman_client | ||
hgcommands | ||
indexedlog | ||
linelog | ||
lz4-pyframe | ||
manifest | ||
mincode | ||
minibench | ||
mpatch | ||
mpatch-sys | ||
mutationstore | ||
nodemap | ||
pathmatcher | ||
procinfo | ||
radixbuf | ||
revisionstore | ||
stackdesc | ||
third-party | ||
treestate | ||
types | ||
util | ||
vlqencoding | ||
watchman_client | ||
workingcopy | ||
zstdelta | ||
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).