Created
May 17, 2022 10:25
-
-
Save TobiX/d152d818ab14713e181f1fcfc39bf653 to your computer and use it in GitHub Desktop.
Quick & dirty bcrypt benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use 5.12.0; | |
use strict; | |
use warnings; | |
use Benchmark ':hireswallclock'; | |
my $time; | |
my $rounds = 0; | |
do { | |
$rounds++; | |
$time = Benchmark::timeit(1, sub { | |
crypt('foobar', "\$2b\$$rounds\$01234567890123456789012") | |
}); | |
say "For $rounds it took ".timestr($time); | |
} while ($time->real < 30); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another datapoint, Ryzen 7 3700X (2019):