Argon2 5个线程比4个线程慢

时间:2018-12-21 22:17:13

标签: php php-password-hash argon2-ffi

我正在使用https://github.com/charlesportwoodii/php-argon2-ext和Argon2一起玩。 当我在使用参数时,我注意到每个内核的速度并没有因此而降低。

在此处查看图表: Time is in seconds

运行代码:

for($threads = 1; $threads <= 8; $threads++) {
    $time1 = microtime(true);

    $options = [
        'm_cost' => 65536,//64MB
        't_cost' => 64,
        'threads' => $threads
    ];

    $password = "secret";
    argon2_hash($password, HASH_ARGON2I, $options);

    $time2 = microtime(true);
    $execution_time = ($time2 - $time1);
    printf("execution time with $threads threads: " . $execution_time . " seconds\n");
}

我的系统: Debian 9 8GB RAM, i7-4710HQ @ 2.50GHz

有人可以解释一下还是可以想到原因?

0 个答案:

没有答案