# Benchmarks
This directory contains the results of various benchmarks.
## CPU-Bounded Benchmarks
### Create task and yield
This benchmark measures the overhead of creating a task, returning from it and yielding. This shows well how expensive
asynchronous abstractions of the engine are. This test has two options. In the first case, the tasks contain only one
number and return it. In the second case, the tasks contain a buffer that contains 9000 bytes on the stack and return
its length.
__Less is better__
__All__

__Favorites only__

### Task switch
This benchmark measures the overhead of switching between tasks.
__Less is better__

### Mutex lock and unlock
This benchmark measures the overhead of locking and unlocking a mutex. This test shows that an asynchronous Mutex can
run just as fast as a synchronous one. So don't be afraid to use orengine::sync::Mutex in your tasks!
__Less is better__

### Memory usage per task
This benchmark measures the memory usage per task. This was measured by creating 10,000,000 sleeping tasks, so the
result cannot be less than 16 bytes (required for std::time::Instant). In fact, it cannot be less than 32 bytes, since
you need to keep at least a wide pointer to the Future or even the Layout.
__Less is better__
__All__

__Favorites only__

## Network Benchmarks
### Echo server
This benchmark measures the TCP echo server throughput. The benchmark below used std::net for the client. For this
benchmark a 12-cpu machine was used and only 1024 connections were made.
__More is better__
