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 | 33.71 | 29.67 ms | ±8.11% | 29.37 ms | 31.68 ms |
PathGlob.match?/2 | 9.72 | 102.88 ms | ±3.13% | 101.61 ms | 117.40 ms |
Run Time Comparison
Name | IPS | Slower |
---|---|---|
GlobEx.match?/2 | 33.71 | |
PathGlob.match?/2 | 9.72 | 3.47x |
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 |