A Scalable, User-Friendly Source Control System.
Go to file
Jun Wu f9fb60337a minibench: add a simple library to do benchmark
Summary:
It's sad to find that existing Rust benchmark frameworks do not fit well in
our simple benchmark purpose. The benchmark library shipped with Rust [1] has
been in "nightly-only" for long. Third-party choices like "criterion.rs" does
too many things and misses certain small features. Namely, indexedlog wants:

  - More stable benchmark result. This means not picking the average time,
    but the "best" time among all runs, like what Mercurial does.
  - Do not measure setup cost from repetitive runs. As in D7404532, do not
    clone the index, and do not have separate "clone" benchmarks.
  - Faster benchmarks. This means getting rid of unused parts like calling
    gnuplot.

Besides, having the test framework to be lightweight also helps compilation
time. Looking at `indexedlog`'s dependencies (with unused "failure"
removed), 70% of them are from `criterion.rs`.

```
indexedlog v0.1.0 (lib/indexedlog)
[dependencies]
|-- atomicwrites v0.1.5
|   [dependencies]
|   |-- nix v0.9.0
|   |   [dependencies]
|   |   |-- bitflags v0.9.1
|   |   |-- cfg-if v0.1.2
|   |   |-- libc v0.2.39
|   |   `-- void v1.0.2
|   `-- tempdir v0.3.6
|       [dependencies]
|       |-- rand v0.4.2
|       |   [dependencies]
|       |   `-- libc v0.2.39 (*)
|       `-- remove_dir_all v0.3.0
|           [dependencies]
|           |-- kernel32-sys v0.2.2
|           |   [dependencies]
|           |   `-- winapi v0.2.8
|           |   [build-dependencies]
|           |   `-- winapi-build v0.1.1
|           `-- winapi v0.2.8 (*)
|-- byteorder v1.2.1
|-- fs2 v0.4.3
|   [dependencies]
|   `-- libc v0.2.39 (*)
|-- memmap v0.6.2
|   [dependencies]
|   `-- libc v0.2.39 (*)
|-- twox-hash v1.1.0
|   [dependencies]
|   `-- rand v0.3.22
|       [dependencies]
|       |-- libc v0.2.39 (*)
|       `-- rand v0.4.2 (*)
`-- vlqencoding v0.1.0 (lib/vlqencoding)
[dev-dependencies]
|-- criterion v0.2.1
|   [dependencies]
|   |-- atty v0.2.8
|   |   [dependencies]
|   |   `-- libc v0.2.39 (*)
|   |-- clap v2.31.1
|   |   [dependencies]
|   |   |-- ansi_term v0.11.0
|   |   |-- atty v0.2.8 (*)
|   |   |-- bitflags v1.0.1
|   |   |-- strsim v0.7.0
|   |   |-- textwrap v0.9.0
|   |   |   [dependencies]
|   |   |   `-- unicode-width v0.1.4
|   |   |-- unicode-width v0.1.4 (*)
|   |   `-- vec_map v0.8.0
|   |-- criterion-plot v0.2.1
|   |   [dependencies]
|   |   |-- byteorder v1.2.1 (*)
|   |   |-- cast v0.2.2
|   |   `-- itertools v0.7.7
|   |       [dependencies]
|   |       `-- either v1.4.0
|   |-- criterion-stats v0.2.1
|   |   [dependencies]
|   |   |-- cast v0.2.2 (*)
|   |   |-- num-traits v0.2.1
|   |   |-- num_cpus v1.8.0
|   |   |   [dependencies]
|   |   |   `-- libc v0.2.39 (*)
|   |   |-- rand v0.4.2 (*)
|   |   `-- thread-scoped v1.0.2
|   |-- failure v0.1.1
|   |   [dependencies]
|   |   |-- backtrace v0.3.5
|   |   |   [dependencies]
|   |   |   |-- backtrace-sys v0.1.16
|   |   |   |   [dependencies]
|   |   |   |   `-- libc v0.2.39 (*)
|   |   |   |   [build-dependencies]
|   |   |   |   `-- cc v1.0.8
|   |   |   |-- cfg-if v0.1.2 (*)
|   |   |   |-- libc v0.2.39 (*)
|   |   |   `-- rustc-demangle v0.1.7
|   |   `-- failure_derive v0.1.1
|   |       [dependencies]
|   |       |-- quote v0.3.15
|   |       |-- syn v0.11.11
|   |       |   [dependencies]
|   |       |   |-- quote v0.3.15 (*)
|   |       |   |-- synom v0.11.3
|   |       |   |   [dependencies]
|   |       |   |   `-- unicode-xid v0.0.4
|   |       |   `-- unicode-xid v0.0.4 (*)
|   |       `-- synstructure v0.6.1
|   |           [dependencies]
|   |           |-- quote v0.3.15 (*)
|   |           `-- syn v0.11.11 (*)
|   |-- failure_derive v0.1.1 (*)
|   |-- handlebars v0.31.0
|   |   [dependencies]
|   |   |-- lazy_static v1.0.0
|   |   |-- log v0.4.1
|   |   |   [dependencies]
|   |   |   `-- cfg-if v0.1.2 (*)
|   |   |-- pest v1.0.6
|   |   |-- pest_derive v1.0.6
|   |   |   [dependencies]
|   |   |   |-- pest v1.0.6 (*)
|   |   |   |-- quote v0.3.15 (*)
|   |   |   `-- syn v0.11.11 (*)
|   |   |-- quick-error v1.2.1
|   |   |-- regex v0.2.10
|   |   |   [dependencies]
|   |   |   |-- aho-corasick v0.6.4
|   |   |   |   [dependencies]
|   |   |   |   `-- memchr v2.0.1
|   |   |   |       [dependencies]
|   |   |   |       `-- libc v0.2.39 (*)
|   |   |   |-- memchr v2.0.1 (*)
|   |   |   |-- regex-syntax v0.5.3
|   |   |   |   [dependencies]
|   |   |   |   `-- ucd-util v0.1.1
|   |   |   |-- thread_local v0.3.5
|   |   |   |   [dependencies]
|   |   |   |   |-- lazy_static v1.0.0 (*)
|   |   |   |   `-- unreachable v1.0.0
|   |   |   |       [dependencies]
|   |   |   |       `-- void v1.0.2 (*)
|   |   |   `-- utf8-ranges v1.0.0
|   |   |-- serde v1.0.33
|   |   `-- serde_json v1.0.11
|   |       [dependencies]
|   |       |-- dtoa v0.4.2
|   |       |-- itoa v0.3.4
|   |       |-- num-traits v0.2.1 (*)
|   |       `-- serde v1.0.33 (*)
|   |-- itertools v0.7.7 (*)
|   |-- itertools-num v0.1.1
|   |   [dependencies]
|   |   `-- num-traits v0.1.43
|   |       [dependencies]
|   |       `-- num-traits v0.2.1 (*)
|   |-- log v0.4.1 (*)
|   |-- serde v1.0.33 (*)
|   |-- serde_derive v1.0.33
|   |   [dependencies]
|   |   |-- proc-macro2 v0.2.3
|   |   |   [dependencies]
|   |   |   `-- unicode-xid v0.1.0
|   |   |-- quote v0.4.2
|   |   |   [dependencies]
|   |   |   `-- proc-macro2 v0.2.3 (*)
|   |   |-- serde_derive_internals v0.21.0
|   |   |   [dependencies]
|   |   |   |-- proc-macro2 v0.2.3 (*)
|   |   |   `-- syn v0.12.14
|   |   |       [dependencies]
|   |   |       |-- proc-macro2 v0.2.3 (*)
|   |   |       |-- quote v0.4.2 (*)
|   |   |       `-- unicode-xid v0.1.0 (*)
|   |   `-- syn v0.12.14 (*)
|   |-- serde_json v1.0.11 (*)
|   `-- simplelog v0.5.0
|       [dependencies]
|       |-- chrono v0.4.0
|       |   [dependencies]
|       |   |-- num v0.1.42
|       |   |   [dependencies]
|       |   |   |-- num-integer v0.1.36
|       |   |   |   [dependencies]
|       |   |   |   `-- num-traits v0.2.1 (*)
|       |   |   |-- num-iter v0.1.35
|       |   |   |   [dependencies]
|       |   |   |   |-- num-integer v0.1.36 (*)
|       |   |   |   `-- num-traits v0.2.1 (*)
|       |   |   `-- num-traits v0.2.1 (*)
|       |   `-- time v0.1.39
|       |       [dependencies]
|       |       `-- libc v0.2.39 (*)
|       |       [dev-dependencies]
|       |       `-- winapi v0.3.4
|       |-- log v0.4.1 (*)
|       `-- term v0.4.6
|-- quickcheck v0.6.2
|   [dependencies]
|   |-- env_logger v0.5.6
|   |   [dependencies]
|   |   |-- atty v0.2.8 (*)
|   |   |-- humantime v1.1.1
|   |   |   [dependencies]
|   |   |   `-- quick-error v1.2.1 (*)
|   |   |-- log v0.4.1 (*)
|   |   |-- regex v0.2.10 (*)
|   |   `-- termcolor v0.3.5
|   |-- log v0.4.1 (*)
|   `-- rand v0.4.2 (*)
|-- rand v0.4.2 (*)
`-- tempdir v0.3.6 (*)
```

[1]: https://github.com/rust-lang/rust/issues/29553

Reviewed By: DurhamG

Differential Revision: D7440254

fbshipit-source-id: 53cdbd470945388db96702ab771a3f73b456da37
2018-04-13 21:51:42 -07:00
.cargo build: vendor in Rust dependencies 2018-01-09 17:48:32 -08:00
contrib dirstate: respect gitignore 2018-04-13 21:51:40 -07:00
distutils_rust windows: fix build_nupkg.py to work in a new setup 2018-04-13 21:50:54 -07:00
doc flake8: enable F821 check 2018-04-13 21:51:09 -07:00
hgdemandimport extensions: forbid "foo=" from importing foreign mercurial modules 2018-01-09 17:06:09 -08:00
hgext perfsuite: add --print and --use-profile 2018-04-13 21:51:41 -07:00
hgext3rd extensions: also search for extension in the 'hgext3rd' package 2016-03-11 10:30:08 +00:00
hgsubversion flake8: resolve some F checks 2018-04-13 21:51:09 -07:00
i18n flake8: enable some E checks 2018-04-13 21:51:09 -07:00
lib minibench: add a simple library to do benchmark 2018-04-13 21:51:42 -07:00
lz4revlog lz4revlog: internalize extension and test 2018-01-03 07:15:33 -08:00
mercurial hg: move bundle2 error part creation to a helper 2018-04-13 21:51:41 -07:00
tests perfsuite: add --print and --use-profile 2018-04-13 21:51:41 -07:00
.clang-format clang-format: configuration for the clang-format source formatter 2015-01-24 17:04:25 -05:00
.editorconfig mercurial: add editorconfig 2016-04-05 18:10:33 +01:00
.flake8 flake8: enable some E checks 2018-04-13 21:51:09 -07:00
.gitignore tests: use an environment variable for getdb.sh location 2018-04-13 21:51:11 -07:00
.hg-vendored-crates build: vendor in Rust dependencies 2018-01-09 17:48:32 -08:00
.hgsigs Added signature for changeset f51ae48a3fd9 2017-12-01 13:49:47 -06:00
.jshintrc hgweb: add .jshintrc with some basic rules 2017-11-22 22:18:06 +08:00
.watchmanconfig watchman: add an empty .watchmanconfig 2018-04-13 21:50:54 -07:00
CONTRIBUTING contributing: add new file with a pointer to the wiki 2016-10-08 10:39:00 -04:00
CONTRIBUTORS Add note to CONTRIBUTORS file 2007-11-07 21:10:30 -06:00
COPYING COPYING: refresh with current address from fsf.org 2011-06-02 11:17:02 -05:00
hg dispatch: move initialization of sys.std* files 2017-10-02 07:18:24 +01:00
hgeditor spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
hgweb.cgi urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
Makefile remotefilelog: move to hgext/ 2018-01-08 18:58:08 -08:00
README.rst doc: rename README to README.rst 2017-09-26 08:37:17 +02:00
setup.py setup: fix packaging 2018-04-13 21:51:41 -07:00

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install::

 $ make            # see install targets
 $ make install    # do a system-wide install
 $ hg debuginstall # sanity-check setup
 $ hg              # see help

Running without installing::

 $ make local      # build for inplace usage
 $ ./hg --version  # should show the latest version

See https://mercurial-scm.org/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.