Commit Graph

12 Commits

Author SHA1 Message Date
eta 2aeac45f49 arti-bench: add concurrency, write benchmark results out to JSON
We now conduct benchmark tests with multiple concurrent streams (by
default; this is configurable by passing `-p` to `arti-bench`).
Currently, these results just get "flattened" for the purposes of
statistical analysis (as in, results_raw contains the results of each
connection's timing summary, across all benchmark runs). This might be
something we wish to change in future.

The stats summary now also records "best" and "worst" values for each
metric, to give a rough idea of the range of values encountered.

Additionally, we now support writing the benchmark results out to a JSON
file. A future commit may integrate this with CI, so that we have
benchmark results for every commit as a build artefact.

(some documentation was also fixed)

part of arti#292
2022-01-18 13:46:36 +00:00
eta 82beb52fca arti-bench: add support for multiple samples & averaging
We now do multiple samples (configurable; default 3) per type of
`arti-bench` benchmark run, and take a mean and median average of all
data collected, in order to hopefully be a bit more resilient to random
outliers / variation.

This uses some `futures::stream::Stream` hacks, which might result in
more connections being made than required (and might impact the TTFB
metrics somewhat, at least for downloading).

Results now get collected into a `BenchmarkResults` struct per type of
benchmark, which will be in turn placed into a `BenchmarkSummary` in a
later commit; this will also add the ability to serialize the latter
struct out to disk, for future reference.

part of arti#292
2022-01-14 15:00:11 +00:00
daniel.eades 1ecf383e8f refactor `arti-bench` 2022-01-13 14:16:01 +00:00
Nick Mathewson 7d3482ca1a Bump all crate versions to 0.0.3. 2022-01-11 09:40:32 -05:00
Nick Mathewson c5f50b7d41 Update README.md files (automated) 2022-01-11 09:37:45 -05:00
eta e6e65d6574 Merge branch 'minimize_deps' into 'main'
Minimize the required version for each dependency.

Closes #275

See merge request tpo/core/arti!228
2022-01-10 13:44:53 +00:00
Neel Chauhan 439b8b3e64 Use *_with_prefs() for Option<ConnectPrefs> callers in TorClient::connect 2022-01-08 13:36:49 -08:00
Nick Mathewson 4841b50c9f Minimize the required version for each dependency.
I found these versions empirically, by using the following process:

First, I used `cargo tree --depth 1 --kind all` to get a list of
every immediate dependency we had.

Then, I used `cargo upgrade --workspace package@version` to change
each dependency to the earliest version with which (in theory) the
current version is semver-compatible.  IOW, if the current version
was 3.2.3, I picked "3".  If the current version was 0.12.8, I
picked "0.12".

Then, I used `cargo +nightly upgrade -Z minimal-versions` to
downgrade Cargo.lock to the minimal listed version for each
dependency.  (I had to override a few packages; see .gitlab-ci.yml
for details).

Finally, I repeatedly increased the version of each of our
dependencies until our code compiled and the tests passed.  Here's
what I found that we need:

anyhow >= 1.0.5: Earlier versions break our hyper example.

async-broadcast >= 0.3.2: Earlier versions fail our tests.

async-compression 0.3.5: Earlier versions handled futures and tokio
    differently.

async-trait >= 0.1.2: Earlier versions are too buggy to compile our
    code.

clap 2.33.0: For Arg::default_value_os().

coarsetime >= 0.1.20: exposed as_ticks() function.

curve25519-dalek >= 3.2: For is_identity().

generic-array 0.14.3: Earlier versions don't implement
    From<&[T; 32]>

httparse >= 1.2: Earlier versions didn't implement Error.

itertools at 0.10.1: For at_most_once.

rusqlite >= 0.26.3: for backward compatibility with older rustc.

serde 1.0.103: Older versions break our code.

serde_json >= 1.0.50: Since we need its Value type to implement Eq.

shellexpand >= 2.1: To avoid a broken dirs crate version.

tokio >= 1.4: For Handle::block_on().

tracing >= 0.1.18: Previously, tracing_core and tracing had separate
    LevelFilter types.

typenum >= 1.12: Compatibility with rust-crypto crates

x25519-dalek >= 1.2.0: For was_contributory().

Closes #275.
2022-01-07 19:08:58 -05:00
Nick Mathewson 5c3300867d Merge remote-tracking branch 'origin/mr/214' 2022-01-06 09:02:09 -05:00
Ian Jackson 1e70d56737 arti-bench: Remove a FIXME by saying it's OK for this program to panic 2022-01-06 11:58:01 +00:00
Daniel Eades 592642a9e6 extend lints to include 'clippy::all' 2021-12-28 20:15:40 +00:00
eta 06a94288ca Introduce an experimental benchmarking utility for Arti
The new `arti-bench` crate does a simple end-to-end benchmark test
embedding Arti: it generates some random data (of configurable amount,
depending on command-line parameters), and then sends said data back and
forth via Arti (which should be configured to use a local Chutney
network).

Additionally, the benchmark can also be run via a local SOCKS5 server
(in order to benchmark the performance via a local Chutney node, for
comparison).

The `tests/chutney/arti-bench.sh` sets up and tears down Chutney as
required to make this work.

This is very much a first cut; there are many things that should
eventually get added, such as support for multiple connections, JSON
output capabilities, running multiple tests, ...
2021-12-16 16:12:59 +00:00