2020-12-12 08:00:42 +00:00
|
|
|
[package]
|
2023-06-28 14:12:40 +00:00
|
|
|
name = "jj-lib"
|
2023-08-05 22:14:11 +00:00
|
|
|
description = "Library for Jujutsu - an experimental version control system"
|
2024-02-02 07:55:24 +00:00
|
|
|
autotests = false
|
2020-12-12 08:00:42 +00:00
|
|
|
|
2023-08-22 16:41:42 +00:00
|
|
|
version = { workspace = true }
|
|
|
|
edition = { workspace = true }
|
|
|
|
rust-version = { workspace = true }
|
|
|
|
license = { workspace = true }
|
|
|
|
homepage = { workspace = true }
|
|
|
|
repository = { workspace = true }
|
|
|
|
documentation = { workspace = true }
|
|
|
|
readme = { workspace = true }
|
2020-12-12 08:00:42 +00:00
|
|
|
|
2024-04-14 22:27:23 +00:00
|
|
|
include = [
|
|
|
|
"/LICENSE",
|
|
|
|
"/benches/",
|
|
|
|
"/src/",
|
|
|
|
"/tests/",
|
|
|
|
"!*.pending-snap",
|
|
|
|
"!*.snap*",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-02-02 07:55:24 +00:00
|
|
|
[[test]]
|
|
|
|
name = "runner"
|
|
|
|
|
2023-03-27 08:23:27 +00:00
|
|
|
[[bench]]
|
|
|
|
name = "diff_bench"
|
|
|
|
harness = false
|
|
|
|
|
2020-12-24 07:12:18 +00:00
|
|
|
[build-dependencies]
|
2023-08-22 16:41:42 +00:00
|
|
|
version_check = { workspace = true }
|
2020-12-12 08:00:42 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2023-10-28 23:15:01 +00:00
|
|
|
async-trait = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
backoff = { workspace = true }
|
|
|
|
blake2 = { workspace = true }
|
|
|
|
bytes = { workspace = true }
|
|
|
|
chrono = { workspace = true }
|
|
|
|
config = { workspace = true }
|
|
|
|
digest = { workspace = true }
|
|
|
|
either = { workspace = true }
|
2023-11-07 07:15:31 +00:00
|
|
|
futures = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
git2 = { workspace = true }
|
2023-10-29 07:21:37 +00:00
|
|
|
gix = { workspace = true }
|
2023-10-19 17:46:26 +00:00
|
|
|
glob = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
hex = { workspace = true }
|
2024-02-16 17:54:09 +00:00
|
|
|
ignore = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
itertools = { workspace = true }
|
2024-02-13 23:10:30 +00:00
|
|
|
jj-lib-proc-macros = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
maplit = { workspace = true }
|
|
|
|
once_cell = { workspace = true }
|
|
|
|
pest = { workspace = true }
|
|
|
|
pest_derive = { workspace = true }
|
2023-10-28 23:15:01 +00:00
|
|
|
pollster = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
prost = { workspace = true }
|
|
|
|
rand = { workspace = true }
|
|
|
|
rand_chacha = { workspace = true }
|
|
|
|
rayon = { workspace = true }
|
2023-11-25 09:05:55 +00:00
|
|
|
ref-cast = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
regex = { workspace = true }
|
|
|
|
serde = { workspace = true }
|
|
|
|
serde_json = { workspace = true }
|
|
|
|
smallvec = { workspace = true }
|
|
|
|
strsim = { workspace = true }
|
|
|
|
tempfile = { workspace = true }
|
|
|
|
thiserror = { workspace = true }
|
2023-08-05 16:14:11 +00:00
|
|
|
tokio = { workspace = true, optional = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
tracing = { workspace = true }
|
2023-08-05 16:14:11 +00:00
|
|
|
watchman_client = { workspace = true, optional = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
whoami = { workspace = true }
|
|
|
|
zstd = { workspace = true }
|
2020-12-12 08:00:42 +00:00
|
|
|
|
2023-05-06 01:54:33 +00:00
|
|
|
[target.'cfg(unix)'.dependencies]
|
2023-08-22 16:41:42 +00:00
|
|
|
rustix = { workspace = true }
|
2023-05-06 01:54:33 +00:00
|
|
|
|
2024-02-04 08:03:03 +00:00
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
|
|
winreg = { workspace = true }
|
|
|
|
|
2020-12-12 08:00:42 +00:00
|
|
|
[dev-dependencies]
|
2023-08-22 16:41:42 +00:00
|
|
|
assert_matches = { workspace = true }
|
|
|
|
criterion = { workspace = true }
|
|
|
|
esl01-renderdag = { workspace = true }
|
2024-03-23 02:34:28 +00:00
|
|
|
indoc = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
insta = { workspace = true }
|
|
|
|
num_cpus = { workspace = true }
|
2023-07-06 06:03:55 +00:00
|
|
|
pretty_assertions = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
test-case = { workspace = true }
|
|
|
|
testutils = { workspace = true }
|
backend: make read functions async
The commit backend at Google is cloud-based (and so are the other
backends); it reads and writes commits from/to a server, which stores
them in a database. That makes latency much higher than for disk-based
backends. To reduce the latency, we have a local daemon process that
caches and prefetches objects. There are still many cases where
latency is high, such as when diffing two uncached commits. We can
improve that by changing some of our (jj's) algorithms to read many
objects concurrently from the backend. In the case of tree-diffing, we
can fetch one level (depth) of the tree at a time. There are several
ways of doing that:
* Make the backend methods `async`
* Use many threads for reading from the backend
* Add backend methods for batch reading
I don't think we typically need CPU parallelism, so it's wasteful to
have hundreds of threads running in order to fetch hundreds of objects
in parallel (especially when using a synchronous backend like the Git
backend). Batching would work well for the tree-diffing case, but it's
not as composable as `async`. For example, if we wanted to fetch some
commits at the same time as we were doing a diff, it's hard to see how
to do that with batching. Using async seems like our best bet.
I didn't make the backend interface's write functions async because
writes are already async with the daemon we have at Google. That
daemon will hash the object and immediately return, and then send the
object to the server in the background. I think any cloud-based
solution will need a similar daemon process. However, we may need to
reconsider this if/when jj gets used on a server with a custom backend
that writes directly to a database (i.e. no async daemon in between).
I've tried to measure the performance impact. That's the largest
difference I've been able to measure was on `jj diff
--ignore-working-copy -s --from v5.0 --to v6.0` in the Linux repo,
which increases from 749 ms to 773 ms (3.3%). In most cases I've
tested, there's no measurable difference. I've tried diffing from the
root commit, as well as `jj --ignore-working-copy log --no-graph -r
'::v3.0 & author(torvalds)' -T 'commit_id ++ "\n"'` (to test a
commit-heavy load).
2023-09-06 19:59:17 +00:00
|
|
|
tokio = { workspace = true, features = ["full"] }
|
2022-03-13 07:03:44 +00:00
|
|
|
|
|
|
|
[features]
|
2023-03-29 18:13:28 +00:00
|
|
|
default = []
|
2022-03-13 07:03:44 +00:00
|
|
|
vendored-openssl = ["git2/vendored-openssl"]
|
2023-07-08 09:23:32 +00:00
|
|
|
watchman = ["dep:tokio", "dep:watchman_client"]
|
revset: add count_estimate() to Revset trait
The count() function in this trait is used by "jj branch" to determine
(and then report) how many commits a certain branch is ahead/behind
another branch. This is currently implemented by walking all commits
in the revset, counting how many were encountered. But this could be
improved: if the number is large, it is probably sufficient to report
"at least N" (instead of walking all the way), and this does not scale
well to jj backends that may not have all commits present locally (which
may prefer to return an estimate, rather than access the network).
Therefore, add a function that is explicitly documented to be O(1)
and that can return a range of values if the backend so chooses.
Also remove count(), as it is not immediately obvious that it is an
expensive call, and callers that are willing to pay the cost can obtain
the exact same functionality through iter().count() anyway. (In this
commit, all users of count() are migrated to iter().count() to preserve
all existing functionality; they will be migrated to count_estimate() in
a subsequent commit.)
"branch" needed to be updated due to this change. Although jj
is currently only available in English, I have attempted to keep
user-visible text from being assembled piece by piece, so that if we
later decide to translate jj into other languages, things will be easier
for translators.
2024-01-16 22:12:02 +00:00
|
|
|
testing = []
|