Mercurial > hg
comparison rust/hg-core/Cargo.toml @ 44386:8f7c6656ac79
rust-nodemap: pure Rust example
To run, use `cargo run --release --example nodemap`
This demonstrates that simple scenarios entirely written
in Rust can content themselves with `NodeTree<T>`.
The example mmaps both the nodemap file and the changelog index.
We had of course to include an implementation of `RevlogIndex`
directly, which isn't much at this stage. It felt a bit
prematurate to include it in the lib.
Here are some first performance measurements, obtained with
this example, on a clone of mozilla-central with 440000
changesets:
(create) Nodemap constructed in RAM in 153.638305ms
(query CAE63161B68962) found in 22.362us: Ok(Some(269489))
(bench) Did 3 queries in 36.418µs (mean 12.139µs)
(bench) Did 50 queries in 184.318µs (mean 3.686µs)
(bench) Did 100000 queries in 31.053461ms (mean 310ns)
To be fair, even between bench runs, results tend to depend whether
the file is still in kernel caches, and it's not so easy to
get back to a real cold start. The worst we've seen was in the
50us ballpark.
In any busy server setting, the pages would always be in RAM.
We hope it's good enough not to be significantly slower on any
concrete Mercurial operation than the C nodetree when fully in RAM,
and of course this implementation has the serious headstart advantage
of persistence.
Differential Revision: https://phab.mercurial-scm.org/D7797
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Tue, 18 Feb 2020 19:11:15 +0100 |
parents | d8d4fa9a7f18 |
children | fe7d2cf0b429 |
comparison
equal
deleted
inserted
replaced
44385:a98ba6983a63 | 44386:8f7c6656ac79 |
---|---|
21 regex = "1.1.0" | 21 regex = "1.1.0" |
22 twox-hash = "1.5.0" | 22 twox-hash = "1.5.0" |
23 same-file = "1.0.6" | 23 same-file = "1.0.6" |
24 | 24 |
25 [dev-dependencies] | 25 [dev-dependencies] |
26 clap = "*" | |
27 memmap = "0.7.0" | |
28 pretty_assertions = "0.6.1" | |
26 tempfile = "3.1.0" | 29 tempfile = "3.1.0" |
27 pretty_assertions = "0.6.1" | |
28 | 30 |
29 [build-dependencies] | 31 [build-dependencies] |
30 cc = { version = "1.0.48", optional = true } | 32 cc = { version = "1.0.48", optional = true } |
31 | 33 |
32 [features] | 34 [features] |