summaryrefslogtreecommitdiffstats
path: root/ci
AgeCommit message (Collapse)Author
2019-12-24chore: move benches to separate crate (#2028)Carl Lerche
This allows the `benches` crate to depend on `tokio` with all feature flags. This is a similar strategy used for `examples`.
2019-12-21chore: fix formatting, remove old rustfmt.toml (#2007)Artem Vorotnikov
`cargo fmt` has a bug where it does not format modules scoped with feature flags.
2019-12-19fs: add deprecated fs::File::seek fn (#1991)Carl Lerche
This fixes an API compatibility regression when `AsyncSeek` was added. Fixes: #1989
2019-11-29chore: prepare v0.2.2 release (#1857)Ivan Petkov
2019-11-22default all feature flags to off (#1811)Carl Lerche
Changes the set of `default` feature flags to `[]`. By default, only core traits are included without specifying feature flags. This makes it easier for users to pick the components they need. For convenience, a `full` feature flag is included that includes all components. Tests are configured to require the `full` feature. Testing individual feature flags will need to be moved to a separate crate. Closes #1791
2019-11-22ci: bring back build tests (#1813)Carl Lerche
This directory was deleted when `cargo hack` was introduced, however there were some tests that were still useful (macro failure output). Also, additional build tests will be added over time.
2019-11-22ci: use -Z avoid-dev-deps in features check instead of --no-dev-deps (#1812)Taiki Endo
2019-11-22ci: generate docs (#1810)Carl Lerche
Check docs as part of CI. This should catch link errors.
2019-11-20chore: enable feature flag check on windows (#1798)Taiki Endo
2019-11-12reorganize modules (#1766)Carl Lerche
This patch started as an effort to make `time::Timer` private. However, in an effort to get the build compiling again, more and more changes were made. This probably should have been broken up, but here we are. I will attempt to summarize the changes here. * Feature flags are reorganized to make clearer. `net-driver` becomes `io-driver`. `rt-current-thread` becomes `rt-core`. * The `Runtime` can be created without any executor. This replaces `enter`. It also allows creating I/O / time drivers that are standalone. * `tokio::timer` is renamed to `tokio::time`. This brings it in line with `std`. * `tokio::timer::Timer` is renamed to `Driver` and made private. * The `clock` module is removed. Instead, an `Instant` type is provided. This type defaults to calling `std::time::Instant`. A `test-util` feature flag can be used to enable hooking into time. * The `blocking` module is moved to the top level and is cleaned up. * The `task` module is moved to the top level. * The thread-pool's in-place blocking implementation is cleaned up. * `runtime::Spawner` is renamed to `runtime::Handle` and can be used to "enter" a runtime context.
2019-11-08chore: update CI config to test on stable (#1747)Taiki Endo
2019-11-05fix clippy (#1737)Carl Lerche
2019-11-03ci: install minimal profile by default (#1729)Taiki Endo
2019-10-31chore: check each feature works properly (#1695)Taiki Endo
It is hard to maintain features list manually, so use cargo-hack's `--each-feature` flag. And cargo-hack provides a workaround for an issue that dev-dependencies leaking into normal build (`--no-dev-deps` flag), so removed own ci tool. Also, compared to running tests on all features, there is not much advantage in running tests on each feature, so only the default features and all features are tested. If the behavior changes depending on the feature, we need to test it as another job in CI.
2019-10-30thread-pool: in-place blocking with new scheduler (#1681)Jon Gjengset
The initial new scheduler PR omitted in-place blocking support. This patch brings it back.
2019-10-29sync: move into `tokio` crate (#1705)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The sync implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.
2019-10-28executor: move into `tokio` crate (#1702)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The executor implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.
2019-10-26io: move into `tokio` crate (#1691)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `io` implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.
2019-10-25net: move into tokio crate (#1683)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `net` implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.
2019-10-22codec: move into tokio-util (#1675)Carl Lerche
Related to #1318, Tokio APIs that are "less stable" are moved into a new `tokio-util` crate. This crate will mirror `tokio` and provide additional APIs that may require a greater rate of breaking changes. As examples require `tokio-util`, they are moved into a separate crate (`examples`). This has the added advantage of being able to avoid example only dependencies in the `tokio` crate.
2019-10-21timer: move `tokio-timer` into `tokio` crate (#1674)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `timer` implementation is now provided by the main `tokio` crate. The `timer` functionality may still be excluded from the build by skipping the `timer` feature flag.
2019-10-21fs: move into `tokio` (#1672)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `fs` implementation is now provided by the main `tokio` crate. The `fs` functionality may still be excluded from the build by skipping the `fs` feature flag.
2019-10-19executor: rewrite the work-stealing thread pool (#1657)Carl Lerche
This patch is a ground up rewrite of the existing work-stealing thread pool. The goal is to reduce overhead while simplifying code when possible. At a high level, the following architectural changes were made: - The local run queues were switched for bounded circle buffer queues. - Reduce cross-thread synchronization. - Refactor task constructs to use a single allocation and always include a join handle (#887). - Simplify logic around putting workers to sleep and waking them up. **Local run queues** Move away from crossbeam's implementation of the Chase-Lev deque. This implementation included unnecessary overhead as it supported capabilities that are not needed for the work-stealing thread pool. Instead, a fixed size circle buffer is used for the local queue. When the local queue is full, half of the tasks contained in it are moved to the global run queue. **Reduce cross-thread synchronization** This is done via many small improvements. Primarily, an upper bound is placed on the number of concurrent stealers. Limiting the number of stealers results in lower contention. Secondly, the rate at which workers are notified and woken up is throttled. This also reduces contention by preventing many threads from racing to steal work. **Refactor task structure** Now that Tokio is able to target a rust version that supports `std::alloc` as well as `std::task`, the pool is able to optimize how the task structure is laid out. Now, a single allocation per task is required and a join handle is always provided enabling the spawner to retrieve the result of the task (#887). **Simplifying logic** When possible, complexity is reduced in the implementation. This is done by using locks and other simpler constructs in cold paths. The set of sleeping workers is now represented as a `Mutex<VecDeque<usize>>`. Instead of optimizing access to this structure, we reduce the amount the pool must access this structure. Secondly, we have (temporarily) removed `threadpool::blocking`. This capability will come back later, but the original implementation was way more complicated than necessary. **Results** The thread pool benchmarks have improved significantly: Old thread pool: ``` test chained_spawn ... bench: 2,019,796 ns/iter (+/- 302,168) test ping_pong ... bench: 1,279,948 ns/iter (+/- 154,365) test spawn_many ... bench: 10,283,608 ns/iter (+/- 1,284,275) test yield_many ... bench: 21,450,748 ns/iter (+/- 1,201,337) ``` New thread pool: ``` test chained_spawn ... bench: 147,943 ns/iter (+/- 6,673) test ping_pong ... bench: 537,744 ns/iter (+/- 20,928) test spawn_many ... bench: 7,454,898 ns/iter (+/- 283,449) test yield_many ... bench: 16,771,113 ns/iter (+/- 733,424) ``` Real-world benchmarks improve significantly as well. This is testing the hyper hello world server using: `wrk -t1 -c50 -d10`: Old scheduler: ``` Running 10s test @ http://127.0.0.1:3000 1 threads and 50 connections Thread Stats Avg Stdev Max +/- Stdev Latency 371.53us 99.05us 1.97ms 60.53% Req/Sec 114.61k 8.45k 133.85k 67.00% 1139307 requests in 10.00s, 95.61MB read Requests/sec: 113923.19 Transfer/sec: 9.56MB ``` New scheduler: ``` Running 10s test @ http://127.0.0.1:3000 1 threads and 50 connections Thread Stats Avg Stdev Max +/- Stdev Latency 275.05us 69.81us 1.09ms 73.57% Req/Sec 153.17k 10.68k 171.51k 71.00% 1522671 requests in 10.00s, 127.79MB read Requests/sec: 152258.70 Transfer/sec: 12.78MB ```
2019-10-07timer: test arm on targets with target_has_atomic less than 64 (#1634)Taiki Endo
2019-09-20timer: 32 bit ARM only has 32 bit atomics. (#1581)Jonathan Bastien-Filiatrault
2019-09-19chore: rm tokio-buf (#1574)Carl Lerche
The crate has not been updated and it does not seem like it is a good path forward.
2019-09-13timer: use our own AtomicU64 on targets with target_has_atomic less than 64 ↵Taiki Endo
(#1538)
2019-08-18docs: fix all rustdoc warnings (#1474)Ivan Petkov
2019-08-18ci: ensure all tests are run for each feature (#1470)Ivan Petkov
* This includes running docs, examples, and lib tests for each added feature, to ensure nothing is broken
2019-08-17signal: move into tokio-net (#1463)Carl Lerche
2019-08-16uds: move into tokio-net (#1462)Carl Lerche
2019-08-16udp: move tokio-udp into tokio-net (#1459)Carl Lerche
2019-08-15tcp: move tokio-tcp into tokio-net (#1456)Carl Lerche
2019-08-15threadpool: move threadpool into tokio-executor (#1452)Carl Lerche
The threadpool is behind a feature flag. Refs: #1264
2019-08-15reactor: rename tokio-reactor -> tokio-net (#1450)Carl Lerche
* reactor: rename tokio-reactor -> tokio-net This is in preparation for #1264
2019-08-15executor: move current-thread into crate (#1447)Carl Lerche
The `CurrentThread` executor is exposed using a feature flag. Refs: #1264
2019-08-11chore: bump to newer nightly (#1426)Taiki Endo
2019-08-10chore: change default lint level to warning and deny warnings in CI (#1416)Taiki Endo
2019-08-07chore: enable full CI run (#1399)Carl Lerche
* update all tests * fix doc examples * misc API tweaks
2019-07-26ci: enable clippy lints (#1335)Taiki Endo
2019-07-19chore: remove tokio-futures facade crate (#1327)Carl Lerche
This switches from using the tokio-futures facade to referencing futures-* crates directly.
2019-07-10tokio: update threaded runtime to std::future (#1280)Carl Lerche
re-enables the threaded runtime and sets it (again) as the default.
2019-07-03ci: scope each tests/examples invocation to a specific crate (#1238)Ivan Petkov
2019-06-30timer: finish updating timer (#1222)Carl Lerche
* timer: restructure feature flags * update timer tests * Add `async-traits` to CI This also disables a buggy `threadpool` test. This test should be fixed in the future. Refs #1225
2019-06-28chore: remove `tokio-trace`, add "Related Projects" to README (#1221)Eliza Weisman
## Motivation The `tokio-trace` and `tokio-trace-core` crates have been renamed to `tracing` and `tracing-core`, and moved to their own repository (`tokio-rs/tracing`). ## Solution This branch removes `tokio-trace` and `tokio-trace-core` from the `tokio` repository. In addition, I've added a "Related Projects" section to the root README, which lists `tracing` (as well as `mio`, and `bytes`) as other libraries maintained by the Tokio project. I thought that this would help folks looking for `tokio-trace` here find it in its new home. In addition, it changes `tokio` to depend on `tracing-core` rather than `tokio-trace-core`. Closes #1159 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-06-27chore: format code and enable rustfmt CI task (#1212)Carl Lerche
2019-06-25macros: re-export `main` macro from `tokio` (#1198)Carl Lerche
Includes minor fixes and a very basic example. Fixes #1183
2019-06-24Update Tokio to use `std::future`. (#1120)Carl Lerche
A first pass at updating Tokio to use `std::future`. Implementations of `Future` from the futures crate are updated to implement `Future` from std. Implementations of `Stream` are moved to a feature flag. This commits disables a number of crates that have not yet been updated.
2019-06-05Merge branch 'v0.1.x' into merge-0.1Carl Lerche
2019-06-05Bump `tokio-sync` to 0.1.6 (#1123)Kevin Leimkuhler