This repo is a small Elixir performance arena for testing serial or parallel processing of big collections.
To test your algorithm:
- Open
lib/process_many.ex
- Add your function. It must start with
process_
and accept two parameters: (1) the collection and (2) a function that accepts one parameter and returns a new value. The name should ideally comprise of your GitHub username and a short description of the algorithm (e.g. mine isprocess_dimitarvp_parallel_chunk
). - Run
mix bench
Benchmark suite executing on the following system:
Operating System | macOS |
---|---|
CPU Information | Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz |
Number of Available Cores | 8 |
Available Memory | 16 GB |
Elixir Version | 1.12.1 |
Erlang Version | 23.3.4.4 |
Benchmark suite executing with the following configuration:
:time | 1 s |
---|---|
:parallel | 1 |
:warmup | 2 s |
Input: big
Run Time
Name | IPS | Average | Devitation | Median | 99th % |
---|---|---|---|---|---|
dominik_serial_0 | 101.00 | 9.90 ms | ±5.02% | 10.05 ms | 12.61 ms |
dimitarvp_parallel_chunk | 34.64 | 28.87 ms | ±2.85% | 28.95 ms | 30.04 ms |
dominik_parallel_0 | 1.36 | 735.78 ms | ±8.15% | 735.78 ms | 778.16 ms |
Comparison
Name | IPS | Slower |
---|---|---|
dominik_serial_0 | 101.00 | |
dimitarvp_parallel_chunk | 34.64 | 2.92x |
dominik_parallel_0 | 1.36 | 74.31x |
Input: medium
Run Time
Name | IPS | Average | Devitation | Median | 99th % |
---|---|---|---|---|---|
dominik_serial_0 | 1027.15 | 0.97 ms | ±6.95% | 0.96 ms | 1.22 ms |
dimitarvp_parallel_chunk | 321.60 | 3.11 ms | ±8.66% | 3.10 ms | 3.84 ms |
dominik_parallel_0 | 15.05 | 66.43 ms | ±4.06% | 66.74 ms | 72.42 ms |
Comparison
Name | IPS | Slower |
---|---|---|
dominik_serial_0 | 1027.15 | |
dimitarvp_parallel_chunk | 321.60 | 3.19x |
dominik_parallel_0 | 15.05 | 68.23x |
Input: small
Run Time
Name | IPS | Average | Devitation | Median | 99th % |
---|---|---|---|---|---|
dominik_serial_0 | 105.35 K | 9.49 μs | ±25.04% | 8.90 μs | 16.90 μs |
dimitarvp_parallel_chunk | 17.32 K | 57.73 μs | ±19.79% | 53.90 μs | 106.90 μs |
dominik_parallel_0 | 1.70 K | 587.24 μs | ±12.59% | 578.40 μs | 792.18 μs |
Comparison
Name | IPS | Slower |
---|---|---|
dominik_serial_0 | 105.35 K | |
dimitarvp_parallel_chunk | 17.32 K | 6.08x |
dominik_parallel_0 | 1.70 K | 61.86x |