Benchmark GlobEx.match?/2
Comparing GlobEx.match?/2
with PathGlob.match?/2
.
PathGlob is a great package to check if a glob expression matches a path. The approach here is to transform the glob into a regex.
Benchmark suite executing on the following system:
Operating System | macOS |
---|---|
CPU Information | Apple M1 |
Number of Available Cores | 8 |
Available Memory | 16 GB |
Elixir Version | 1.17.2 |
Erlang Version | 27.0.1 |
Benchmark suite executing with the following configuration:
:time | 10 s |
---|---|
:parallel | 1 |
:warmup | 2 s |
Run Time
Name | IPS | Average | Devitation | Median | 99th % |
---|---|---|---|---|---|
GlobEx.match?/2 | 36.79 | 27.18 ms | ±1.82% | 27.10 ms | 28.92 ms |
PathGlob.match?/2 | 10.21 | 97.90 ms | ±0.86% | 97.52 ms | 102.13 ms |
Run Time Comparison
Name | IPS | Slower |
---|---|---|
GlobEx.match?/2 | 36.79 | |
PathGlob.match?/2 | 10.21 | 3.6x |
Memory Usage
Name | Average | Factor |
---|---|---|
GlobEx.match?/2 | 62.87 MB | |
PathGlob.match?/2 | 217.05 MB | 3.45x |
Reduction Count
Name | Average | Factor |
---|---|---|
GlobEx.match?/2 | 3.50 M | |
PathGlob.match?/2 | 8.18 M | 2.34x |