Skip to content

Commit

Permalink
improve perf of eden clone
Browse files Browse the repository at this point in the history
Summary:
improve perf of eden clone

Eden clone takes around 2 seconds, and it includes calling `hg config --local` command 2
times in row where each call takes ~300 ms. So, this diff would make the config
setup into 1 `hg config` call saving us 300 ms of time, wich is a good win for
SCM on RE project where we aim to minimise latency.

Reviewed By: muirdm

Differential Revision: D68893490

fbshipit-source-id: 19dc9beacb1ac127de1ba15fbe751541a2d0626d
  • Loading branch information
Liubov Dmitrieva authored and facebook-github-bot committed Jan 30, 2025
1 parent df7fc3b commit 251da60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions eden/fs/cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,17 +816,18 @@ def _post_clone_checkout_setup(
env=env,
)

configs = dict()
configs = {}
if checkout.get_config().scm_type == "filteredhg":
configs["extensions.edensparse"] = ""
configs["extensions.sparse"] = "!"
for k, v in configs.items():
if len(configs) > 0:
args = [f"{k}={v}" for k, v in configs.items()]
subprocess.check_call(
[
os.environ.get("EDEN_HG_BINARY", "hg"),
"config",
"--local",
f"{k}={v}",
*args,
"-R",
str(checkout.path),
],
Expand Down

0 comments on commit 251da60

Please sign in to comment.