aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-bench
Commit message (Collapse)AuthorAgeFilesLines
...
* Semantic version changes for Arti 0.4.0 releaseNick Mathewson2022-05-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | I followed the following procedure to make these changes: * I used maint/changed_crates to find out which crates had changed since 0.3.0. * I used grep and maint/list_crates to sort those crates in topological (dependency) order. * I looked through semver_status to find which crates were listed as having semver-relevant changes (new APIs and breaking changes). * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no changes. For those crates, I incremented their patch-level version _without_ changing the version that other crates depend on. * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no obvious breaking changes. * I treated all crates that depend on `arti` and/or `arti-client` as having breaking changes. * I identified crates that depend on crates that have changed, even if they have not changed themselves, and identified them as having a non-breaking change. * For all of the crates, I used `cargo set-version -p $CRATE --bump $STATUS` (where `STATUS` is `patch` or `minor`) to update the versions, and the depended-upon versions.
* Split TorClientConfig out of ArtiConfig, and Resolvable traitIan Jackson2022-05-241-3/+2
| | | | | | | | | | | | This gets rid of `#[serde(flatten)]` which prevents serde_ignored (and other kinds of introspection) from working properly. The price is now that the toplevel has to deal with two configuration objects. The Resolvable trait is overkill right now, but is going to do More Things in a moment. In particular, we need the impl on tuples, so that the whole config can be processed in one go.
* fs-mistrust: make Mistrust have a corresponding Builder type.Nick Mathewson2022-05-241-2/+1
| | | | | This is an approximately minimal revision to get Builder in place; subsequent commits will clean up the API.
* Abolish arti-config, replacing with tombstone crateIan Jackson2022-05-131-1/+0
|
* arti-config abolition: Change references to use tor_configIan Jackson2022-05-132-1/+3
| | | | | | | | Generally, change the paths that mention the crate name to go via a module-level "use". This involves adding tor-config as a direct dependency for a few crates.
* arti-bench: Disable all fs permissions (fs-mistrust) checksIan Jackson2022-05-132-0/+8
| | | | | | | | | This is a benchmarking tool, and fs-mistrust doesn't like the permissions in our CI. The env var ARTI_FS_DISABLE_PERMISSION_CHECKS is (of course) specific to arti. Maybe it should be honoured here, or this should be done via the config files. But disabling this is fine for now.
* ConfigurationSource: Rename new to new_emptyIan Jackson2022-05-111-1/+1
| | | | | This emphasises its nature. We're going to provide a more cooked constructor in a moment.
* Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-061-5/+5
| | | | * Except for safelog and fs-mistrust, which are new.
* serde attributes: A tiny bit of reorderingIan Jackson2022-05-051-2/+2
| | | | Having a consistent order will make the nest commit easier to read.
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-6/+6
| | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-011-5/+5
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-1/+0
|
* Merge branch 'no-system-time' into 'main'eta2022-03-301-0/+1
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * remove most usage of SystemTime::nowtrinity-1686a2022-02-251-0/+1
| |
* | rename *_isolation_group to *_isolationtrinity-1686a2022-03-241-1/+1
| |
* | Move ArtiConfig to new arti::cfg moduleIan Jackson2022-03-212-1/+2
| | | | | | | | Code motion and import fixups.
* | Actually throw an anyhowIan Jackson2022-03-181-1/+1
| | | | | | | | Prompted by a compiler warning which I weirdly can't seem to reproduce?
* | Alternative API for set_isolation_group().Nick Mathewson2022-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Instead of requiring a `Box<dyn Isolation>`, it now takes either a `Box<dyn Isolation>`, or an arbitrary `T` that implements `Isolation`. This API still allows the user to pass in a `Box<dyn Isolation>` if that's what they have, but it doesn't require them to Box the isolation on their own. Part of #414.
* | accept boxed isolation in StreamPref::set_isolation_grouptrinity-1686a2022-03-161-1/+1
| |
* | arti-bench: don't allocate a separate receive-buffer for each jobNick Mathewson2022-03-081-9/+26
| | | | | | | | | | | | This makes heap profiling more viable. Closes #391.
* | arti-bench: documentation fixesNick Mathewson2022-03-071-5/+6
| |
* | arti-bench: record streams_per_circ and circs_per_sample.Nick Mathewson2022-03-071-5/+14
| |
* | Fix an unwrap() error.Nick Mathewson2022-03-041-1/+1
| |
* | arti-bench: use isolation to support multiple circuits per run.Nick Mathewson2022-03-041-14/+104
| |
* | arti-bench: simplify future-creation code slightlyNick Mathewson2022-03-041-8/+3
| |
* | arti-bench: refactor stream construction to connect in parallelNick Mathewson2022-03-041-33/+15
| | | | | | | | | | | | | | | | | | | | | | | | Previously we tried to do each connection in a run, and only then did we start transferring data over them. Now we collect a bunch of the futures that return an open stream, and run them all in parallel with using them. This change includes connect-time in our benchmarks, and allows us to test contention in our connect code. Instead of using a Stream, I've changed the connection-generation code to call a future-returning function directly, so we have a way to explicitly pass which run we're in.
* | Merge branch 'clippy-allow-arc-clone' into 'main'Nick Mathewson2022-03-011-1/+0
|\ \ | | | | | | | | | | | | Disable clippy::clone_on_ref_ptr See merge request tpo/core/arti!352
| * | Disable clippy::clone_on_ref_ptrIan Jackson2022-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lint is IMO inherently ill-conceived. I have looked for the reasons why this might be thought to be a good idea and there were basically two (and they are sort of contradictory): I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact that only the pointer is being cloned, not the underlying data." This is the wording from https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr It is a bit terse; we are left to infer why it is a bad idea to obscure this fact. It seems to me that if it is bad to obscure some fact, that must be because the fact is a hazard. But why would it be a hazard to not copy the underlying data ? In other languages, faliing to copy the underlying data is a serious correctness hazard. There is a whose class of bugs where things were not copied, and then mutated and/or reused in multiple places in ways that were not what the programmer intended. In my experience, this is a very common bug when writing Python and Javascript. I'm told it's common in golang too. But in Rust this bug is much much harder to write. The data inside an Arc is immutable. To have this bug you'd have use interior mutability - ie mess around with Mutex or RefCell. That provides a good barrier to these kind of accidents. II. "The reason for writing Rc::clone and Arc::clone [is] to make it clear that only the pointer is being cloned, as opposed to the underlying data. The former is always fast, while the latter can be very expensive depending on what is being cloned." This is the reasoning found here https://github.com/rust-lang/rust-clippy/issues/2048 This is saying that *not* using Arc::clone is hazardous. Specifically, that a deep clone is a performance hazard. But for this argument, the lint is precisely backwards. It's linting the "good" case and asking for it to be written in a more explicit way; while the supposedly bad case can be written conveniently. Also, many objects (in our codebase, and in all the libraries we use) that are Clone are in fact simply handles. They contain Arc(s) (or similar) and are cheap to clone. Indeed, that is the usual case. It does not make sense to distinguish in the syntax we use to clone such a handle, whether the handle is a transparent Arc, or an opaque struct containing one or more other handles. Forcing Arc::clone to be written as such makes for code churn when a type is changed from Arc<Something> to Something: Clone, or vice versa.
* | | Bump all crates to 0.1.0arti-v0.1.0Nick Mathewson2022-03-011-4/+4
| | |
* | | arti-client: use PreferredRuntime by default, doc cleanupseta2022-02-281-3/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes using the `PreferredRuntime` the first-class option inside `arti-client`, freeing users who don't want to think about runtimes from having to do so. `TorClient::create_unbootstrapped` and `builder` now automatically use this runtime, leaving only `builder_custom` for users who wish to manually specify a runtime. This lets us clean up the docs a lot: mentions of using custom runtimes are now relegated to nearer the end of the crate-level documentation, and we mostly just link to `tor_rtcompat`'s docs to explain more there. Instead, we take some more time to explain how you use the builder API to create clients synchronously. Other doc cleanups included getting rid of the explanation of `TorAddr` in the main crate-level doc; this is already well-documented elsewhere, and is something users should discover organically later. fixes arti#326
* | Bump minimum tokio to 1.7, since tokio-util now needs that.Nick Mathewson2022-02-251-1/+1
| |
* | Upgrade to newer version of config crate.Nick Mathewson2022-02-251-0/+1
|/
* Bump anyhow minimal version to 1.0.23Ian Jackson2022-02-181-1/+1
| | | | | | | | | | | | | This is the first one where anyhow::Error impl AsRef<dyn StdError> We want this because we want to add error reporting functionality which works with all kinds of errors, which means we need an anyhow::Error which can be vieweed as a StdError. (The alternative would be to deref at the call sites of report_and_exit, making it less ergonomic.) anyhow 1.0.23 is from November 2019.
* Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
| | | | Closes #338.
* Allow creating unbootstrapped `TorClient`s (and `DirMgr`s)eta2022-02-111-1/+1
| | | | | | | | | | | | | | | This commit changes how the `TorClient` type works, enabling it to be constructed synchronously without initiating the bootstrapping process. Daemon tasks are still started on construction (although some of them won't do anything if the client isn't bootstrapped). The old bootstrap() methods are now reimplemented in terms of the new create_unbootstrapped() and bootstrap_existing() methods. This required refactoring how the `DirMgr` works to enable the same sort of thing there. closes #293
* Merge branch 'dirclient-testing' into 'main'Nick Mathewson2022-02-031-1/+1
|\ | | | | | | | | dir-client: bug fix and more tests See merge request tpo/core/arti!271
| * Upgrade required version of futures crate to 0.3.14Nick Mathewson2022-02-011-1/+1
| | | | | | | | | | Earlier versions have a bug in UnboundedReceiver that make our new dirclient tests fail.
* | Fix typosDimitris Apostolou2022-02-021-1/+1
| |
* | Merge branch 'reload-config-prep' into 'main'Ian Jackson2022-02-021-7/+5
|\ \ | | | | | | | | | | | | Preparatory work for auto config reload See merge request tpo/core/arti!284
| * | arti_config: Refactor configuration sources into a structNick Mathewson2022-02-011-7/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is by no means our final API, but should represent an improvement. Here instead of having to specify a list of files and their is-this-optional status, along with a list of command-line options, we have a single structure that encapsulates all of that information. Two advantages here: - Callers no longer have to remember what the boolean means. - We can "reload" more easily, by keeping the source object around. This change also implements the correct behavior for our default configuration file in `arti::main`: if the file is absent and the user doesn't list a config file, that's no problem. But if the user lists _that very same config file, we should insist that it be present.
* / arti-bench: summarize statistics with a new `Statistic` type (#298)eta2022-02-011-49/+86
|/ | | | | | | | This implements the proposal from arti#298, making the `BenchmarkResults` type be made out of a bunch of new `Statistic` types (which summarize the mean, median, range, and standard deviation of an arbitrary value) instead of overloading `TimingSummary` for this purpose.
* Bump the patch version of every crate that changed since 0.0.3Nick Mathewson2022-01-311-4/+4
|
* Make the native-tls crate optional.Nick Mathewson2022-01-261-1/+1
| | | | | | | | | | | This commit puts the native-tls crate behind a feature. The feature is off-by-default in the tor-rtcompat crate, but can be enabled either from arti or arti-client. There is an included script that I used to test that tor-rtcompat could build and run its tests with all subsets of its features. Closes #300
* Make current/create functions into runtime member functions.Nick Mathewson2022-01-261-1/+1
| | | | | This should help avoid some amount of temptation towards API proliferation.
* arti-bench: add concurrency, write benchmark results out to JSONeta2022-01-181-20/+95
| | | | | | | | | | | | | | | | | | | | 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
* arti-bench: add support for multiple samples & averagingeta2022-01-142-30/+172
| | | | | | | | | | | | | | | | | | 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
* refactor `arti-bench`daniel.eades2022-01-131-117/+159
|