Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move argon2 to first, average, worst scoring. #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions JetStreamDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1999,27 +1999,29 @@ const testPlans = [
{
name: "argon2-wasm",
files: [
"./wasm/argon2-bundle.js",
"./wasm/argon2.js",
"./wasm/argon2-benchmark.js"
"./wasm/argon2/argon2-bundle.js",
"./wasm/argon2/argon2.js",
"./wasm/argon2/benchmark.js"
],
preload: {
argon2WasmBlob: "./wasm/argon2.wasm",
argon2WasmBlob: "./wasm/argon2/argon2.wasm",
},
benchmarkClass: WasmLegacyBenchmark,
benchmarkClass: WasmEMCCBenchmark,
iterations: 15,
worstCaseCount: 2,
testGroup: WasmGroup
},
{
name: "argon2-wasm-simd",
files: [
"./wasm/argon2-bundle.js",
"./wasm/argon2.js",
"./wasm/argon2-benchmark.js"
"./wasm/argon2/argon2-bundle.js",
"./wasm/argon2/argon2.js",
"./wasm/argon2/benchmark.js"
],
preload: {
argon2WasmSimdBlob: "./wasm/argon2-simd.wasm",
argon2WasmSimdBlob: "./wasm/argon2/argon2-simd.wasm",
},
benchmarkClass: WasmLegacyBenchmark,
benchmarkClass: WasmEMCCBenchmark,
testGroup: WasmGroup
},
// WorkerTests
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 15 additions & 17 deletions wasm/argon2-benchmark.js → wasm/argon2/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Apple Inc. All rights reserved.
* Copyright (C) 2023-2024 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand All @@ -23,22 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

async function doRun() {
let start = benchmarkTime();

if (!isInBrowser) {
globalThis.argon2WasmSimdBlob = Module.argon2WasmSimdBlob;
globalThis.argon2WasmBlob = Module.argon2WasmBlob;
}

await instantiateArgon2WasmInstance();
await testArgon2HashAndVerify();
reportCompileTime(benchmarkTime() - start);
class Benchmark {
firstIteration = true;
async runIteration() {
if (this.firstIteration) {
this.firstIteration = false;
if (!isInBrowser) {
globalThis.argon2WasmSimdBlob = Module.argon2WasmSimdBlob;
globalThis.argon2WasmBlob = Module.argon2WasmBlob;
}

start = benchmarkTime();
await instantiateArgon2WasmInstance();
}

for (let i = 0; i < 5; ++i)
await testArgon2HashAndVerify();

reportRunTime(benchmarkTime() - start)
}
return await testArgon2HashAndVerify();
}
};