0

我正在使用https://github.com/charlesportwoodii/php-argon2-ext来玩 Argon2。当我在玩参数时,我注意到每个核心的速度并没有相应地降低。

在此处查看图表: 时间以秒为单位

编写代码:

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

有人可以解释这一点或能想到一个原因吗?

4

0 回答 0