Skip to content

Commit 89e8367

Browse files
committed
Update "examples/zkprogram/runtime-table" example to use the performance regression framework
1 parent afa8868 commit 89e8367

File tree

1 file changed

+7
-0
lines changed
  • src/examples/zkprogram/runtime-table

1 file changed

+7
-0
lines changed

src/examples/zkprogram/runtime-table/run.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { Field, verify } from 'o1js';
22
import { PayrollRuntimeTableZkProgram } from './payroll.js';
3+
import { perfStart, perfEnd } from '../../../lib/testing/perf-regression.js';
34

5+
const cs = await PayrollRuntimeTableZkProgram.analyzeMethods();
6+
7+
perfStart('compile', PayrollRuntimeTableZkProgram.name);
48
let { verificationKey } = await PayrollRuntimeTableZkProgram.compile({ withRuntimeTables: true });
9+
perfEnd();
510

611
export const examplePayrollPublicInput = Field(1600_00); // total withheld (cents)
712
export const examplePayrollPrivateInputs = [
@@ -13,9 +18,11 @@ export const examplePayrollPrivateInputs = [
1318
Field(3_000), // Charlie rate
1419
] as const;
1520

21+
perfStart('prove', PayrollRuntimeTableZkProgram.name, cs, 'verifyPayroll');
1622
let { proof } = await PayrollRuntimeTableZkProgram.verifyPayroll(
1723
examplePayrollPublicInput,
1824
...examplePayrollPrivateInputs
1925
);
26+
perfEnd();
2027

2128
verify(proof, verificationKey);

0 commit comments

Comments
 (0)