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) Xeon(R) W-2150B CPU @ 3.00GHz |
Number of Available Cores | 20 |
Available Memory | 64 GB |
Elixir Version | 1.18.3 |
Erlang Version | 27.3.1 |
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 | 289.81 | 3.45 ms | ±3.78% | 3.43 ms | 4.00 ms |
dimitarvp_parallel_chunk | 1.61 | 619.25 ms | ±0.38% | 619.25 ms | 620.90 ms |
dominik_parallel_0 | 1.07 | 937.29 ms | ±2.40% | 937.29 ms | 953.22 ms |
Comparison
Name | IPS | Slower |
---|---|---|
dominik_serial_0 | 289.81 | |
dimitarvp_parallel_chunk | 1.61 | 179.47x |
dominik_parallel_0 | 1.07 | 271.64x |
Input: medium
Run Time
Name | IPS | Average | Devitation | Median | 99th % |
---|---|---|---|---|---|
dominik_serial_0 | 3131.69 | 0.32 ms | ±4.82% | 0.31 ms | 0.38 ms |
dominik_parallel_0 | 19.11 | 52.34 ms | ±3.21% | 51.98 ms | 56.40 ms |
dimitarvp_parallel_chunk | 16.18 | 61.82 ms | ±1.39% | 61.90 ms | 63.88 ms |
Comparison
Name | IPS | Slower |
---|---|---|
dominik_serial_0 | 3131.69 | |
dominik_parallel_0 | 19.11 | 163.92x |
dimitarvp_parallel_chunk | 16.18 | 193.61x |
Input: small
Run Time
Name | IPS | Average | Devitation | Median | 99th % |
---|---|---|---|---|---|
dominik_serial_0 | 306.04 K | 3.27 μs | ±83.62% | 3.11 μs | 6.45 μs |
dominik_parallel_0 | 2.35 K | 425.34 μs | ±7.95% | 424.26 μs | 509.94 μs |
dimitarvp_parallel_chunk | 1.62 K | 615.67 μs | ±7.77% | 609.40 μs | 776.43 μs |
Comparison
Name | IPS | Slower |
---|---|---|
dominik_serial_0 | 306.04 K | |
dominik_parallel_0 | 2.35 K | 130.17x |
dimitarvp_parallel_chunk | 1.62 K | 188.42x |