-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
75 additions
and
74 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Specific runner for o1js initialization benchmarks to get "clean" metrics | ||
* | ||
* Run with | ||
* ``` | ||
* ./run benchmark/runners/init.ts --bundle | ||
* ``` | ||
*/ | ||
|
||
import { benchmark } from '../benchmark.js'; | ||
import { processAndLogBenchmarkResults } from '../utils/result-utils.js'; | ||
|
||
const InitBenchmarks = benchmark( | ||
'init', | ||
async (tic, toc) => { | ||
tic('o1js import'); | ||
const { initializeBindings } = await import('o1js'); | ||
toc(); | ||
|
||
tic('bindings initialization'); | ||
await initializeBindings(); | ||
toc(); | ||
}, | ||
// Run once with no warmups to get the worst-case scenario metrics | ||
{ numberOfWarmups: 0, numberOfRuns: 1 } | ||
); | ||
|
||
// Run the initialization benchmarks and collect results | ||
const results = [...(await InitBenchmarks.run())]; | ||
|
||
// Process and log results | ||
await processAndLogBenchmarkResults(results); |
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Benchmark results processing utils | ||
*/ | ||
|
||
import { BenchmarkResult, logResult } from '../benchmark.js'; | ||
import { | ||
readPreviousResultFromInfluxDb, | ||
writeResultToInfluxDb, | ||
} from './influxdb-utils.js'; | ||
|
||
export async function processAndLogBenchmarkResults( | ||
results: BenchmarkResult[] | ||
): Promise<void> { | ||
for (const result of results) { | ||
const previousResult = await readPreviousResultFromInfluxDb(result); | ||
logResult(result, previousResult); | ||
writeResultToInfluxDb(result); | ||
console.log('\n'); | ||
} | ||
} |
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