Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #741
Compiled behind Cargo feature: "async"
To compile the "dyonrun" example with async:
cargo build --release --features="async" --example dyonrun
Why async?
Dyon uses a Go-like model for concurrency. However, until now this used one OS thread per co-routine.
Since it is expensive to swap between threads in the OS, this becomes a bottleneck.
Async code in Rust makes it possible to execute thousands of tasks in parallel at much higher performance, using an executor runtime like Tokio.
Example
This example sums the first 10 000 natural numbers, creating a task for each number:
test.dyon
On my laptop:
Without async (default):
3.15s user 1.82s system 118% cpu 4.185 total
With async:
0.06s user 0.02s system 155% cpu 0.057 total