-
Notifications
You must be signed in to change notification settings - Fork 20
Benchmark
Navid edited this page Apr 19, 2020
·
3 revisions
Batch renaming of 1000 files from Nomino (2020) S5.E$e.1080p.mkv
to $e.mkv
.
- Os: Linux 5.6.4 x86_64
- Memory: 12 GiB
- CPU: Intel® Core™ i7-4500U CPU @ 1.80GHz × 4
- Disk: Samsung SSD EVO-850
- Tool: hyperfine
Tool | Language | Time (ms) | User (ms) | System (ms) |
---|---|---|---|---|
nomino | Rust | 7.3 | 3.1 | 4.4 |
brename | Go | 19.1 | 8.2 | 12.6 |
rnm | C++ | 37.8 | 24.9 | 12.6 |
rnr | Rust | 35.9 | 14.6 | 21.0 |
rename | Perl | 44.4 | 36.4 | 7.8 |
node-rename-cli | Javascript | 274.2 | 329.2 | 30.0 |
lower value is better
➜ cat prepare-script.sh
rm -f *.mkv
for i in {1..1000}; do touch "Nomino (2020) S5.E$i.1080p.mkv"; done
- nomino
➜ hyperfine -p "prepare-script.sh" 'nomino -r ".*E(\d+).*" "{}.mkv"'
Benchmark #1: nomino -r ".*E(\d+).*" "{}.mkv"
Time (mean ± σ): 7.3 ms ± 0.6 ms [User: 3.1 ms, System: 4.4 ms]
Range (min … max): 6.7 ms … 8.4 ms 10 runs
- brename
➜ hyperfine -p "prepare-script.sh" './brename -p ".*E(\d+).*" -r \$1.mkv -q'
Benchmark #1: ./brename -p ".*E(\d+).*" -r \$1.mkv -q
Time (mean ± σ): 19.1 ms ± 0.6 ms [User: 8.2 ms, System: 12.6 ms]
Range (min … max): 18.0 ms … 19.9 ms 10 runs
- rnm
➜ hyperfine -p "prepare-script.sh" 'rnm -q -rs "/.*E(\d+).*$/\1.mkv/" *.mkv'
Benchmark #1: rnm -q -rs "/.*E(\d+).*$/\1.mkv/" *.mkv
Time (mean ± σ): 37.8 ms ± 1.6 ms [User: 24.9 ms, System: 12.6 ms]
Range (min … max): 36.0 ms … 41.7 ms 10 runs
- rnr
➜ hyperfine -p "prepare-script.sh" 'rnr -sf ".*E(\d+).*" "\$1.mkv" *.mkv'
Benchmark #1: rnr -sf ".*E(\d+).*" "\$1.mkv" *.mkv
Time (mean ± σ): 35.9 ms ± 1.3 ms [User: 14.6 ms, System: 21.0 ms]
Range (min … max): 34.1 ms … 38.0 ms 10 runs
- rename
➜ hyperfine -p "prepare-script.sh" 'rename "s/.*E(\d+).*$/\$1.mkv/" *.mkv'
Benchmark #1: perl-rename "s/.*E(\d+).*$/\$1.mkv/" *.mkv
Time (mean ± σ): 44.4 ms ± 1.0 ms [User: 36.4 ms, System: 7.8 ms]
Range (min … max): 43.3 ms … 46.8 ms 10 runs
- node-rename-cli
➜ hyperfine -p "prepare-script.sh" 'rname -n -f -r ".*E(?<episode>\d+).*" *.mkv "{{episode}}.mkv"'
Benchmark #1: rname -n -f -r ".*E(?<episode>\d+).*" *.mkv "{{episode}}.mkv"
Time (mean ± σ): 274.2 ms ± 9.9 ms [User: 329.2 ms, System: 30.0 ms]
Range (min … max): 262.0 ms … 297.8 ms 10 runs