mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
47c9a35747
This pull request completely rewrites std::comm and all associated users. Some major bullet points * Everything now works natively * oneshots have been removed * shared ports have been removed * try_recv no longer blocks (recv_opt blocks) * constructors are now Chan::new and SharedChan::new * failure is propagated on send * stream channels are 3x faster I have acquired the following measurements on this patch. I compared against Go, but remember that Go's channels are fundamentally different than ours in that sends are by-default blocking. This means that it's not really a totally fair comparison, but it's good to see ballpark numbers for anyway ``` oneshot stream shared1 std 2.111 3.073 1.730 my 6.639 1.037 1.238 native 5.748 1.017 1.250 go8 1.774 3.575 2.948 go8-inf slow 0.837 1.376 go8-128 4.832 1.430 1.504 go1 1.528 1.439 1.251 go2 1.753 3.845 3.166 ``` I had three benchmarks: * oneshot - N times, create a "oneshot channel", send on it, then receive on it (no task spawning) * stream - N times, send from one task to another task, wait for both to complete * shared1 - create N threads, each of which sends M times, and a port receives N*M times. The rows are as follows: * `std` - the current libstd implementation (before this pull request) * `my` - this pull request's implementation (in M:N mode) * `native` - this pull request's implementation (in 1:1 mode) * `goN` - go's implementation with GOMAXPROCS=N. The only relevant value is 8 (I had 8 cores on this machine) * `goN-X` - go's implementation where the channels in question were created with buffers of size `X` to behave more similarly to rust's channels. |
||
---|---|---|
.. | ||
lib | ||
po | ||
favicon.inc | ||
manual.inc | ||
po4a.conf | ||
prep.js | ||
README | ||
rust.css | ||
rust.md | ||
rustdoc.md | ||
rustpkg.md | ||
tutorial-borrowed-ptr.md | ||
tutorial-conditions.md | ||
tutorial-container.md | ||
tutorial-ffi.md | ||
tutorial-macros.md | ||
tutorial-rustpkg.md | ||
tutorial-tasks.md | ||
tutorial.md | ||
version_info.html.template |
Pandoc, a universal document converter, is required to generate docs as HTML from Rust's source code. It's available for most platforms here: http://johnmacfarlane.net/pandoc/installing.html Node.js (http://nodejs.org/) is also required for generating HTML from the Markdown docs (reference manual, tutorials, etc.) distributed with this git repository. To generate all the docs, run `make docs` from the root of the repository. This will convert the distributed Markdown docs to HTML and generate HTML doc for the 'std' and 'extra' libraries. To generate HTML documentation from one source file/crate, do something like: rustdoc --output-dir html-doc/ --output-format html ../src/libstd/path.rs (This, of course, requires that you've built/installed the `rustdoc` tool.) To generate an HTML version of a doc from Markdown, without having Node.js installed, do something like: pandoc --from=markdown --to=html5 --number-sections -o rust.html rust.md The syntax for pandoc flavored markdown can be found at: http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown A nice quick reference (for non-pandoc markdown) is at: http://kramdown.rubyforge.org/quickref.html