-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
b2fe3b2
commit ff665ee
Showing
14 changed files
with
222 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { AreaChart, Area, XAxis, YAxis, Tooltip, Legend, CartesianGrid, Label } from 'recharts'; | ||
import data from '../public/benchmarks/proof-size.json'; // import JSON data | ||
|
||
// Custom Tooltip component | ||
const CustomTooltip = ({ active, payload, label }) => { | ||
if (active) { | ||
return ( | ||
<div style={{ backgroundColor: 'rgba(255,255,255,0)', border: 'none', boxShadow: 'none' }}> | ||
<p>{`Date: ${label}`}</p> | ||
<p>{`Size: ${payload[0].value}kB`}</p> | ||
</div> | ||
); | ||
} | ||
return null; | ||
}; | ||
|
||
function ProofSizeAreaChart() { | ||
return ( | ||
<AreaChart width={750} height={400} data={data} margin={{ top: 20, right: 40, left: 100, bottom: 50 }}> | ||
<defs> | ||
<linearGradient id="colorDuration" x1="0" y1="0" x2="0" y2="1"> | ||
<stop offset="5%" stopColor="#fcba03" stopOpacity={0.8}/> | ||
<stop offset="55%" stopColor="#fcba03" stopOpacity={0}/> | ||
</linearGradient> | ||
</defs> | ||
<XAxis dataKey="name" axisLine={false} height={50}> | ||
<Label value="Date" position="insideBottomLeft" offset={-5} /> | ||
</XAxis> | ||
<YAxis axisLine={false} width={80}> | ||
<Label value="Proof Size" angle={-90} position="center" offset={20} /> | ||
</YAxis> | ||
<CartesianGrid vertical={false} strokeDasharray="3 3" /> | ||
<Tooltip content={<CustomTooltip />} /> | ||
<Legend /> | ||
<Area type="monotone" dataKey="size" stroke="#fcba03" fillOpacity={1} fill="url(#colorDuration)" /> | ||
</AreaChart> | ||
); | ||
} | ||
|
||
export default ProofSizeAreaChart; |
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,40 @@ | ||
import { AreaChart, Area, XAxis, YAxis, Tooltip, Legend, CartesianGrid, Label } from 'recharts'; | ||
import data from '../public/benchmarks/credential-proving.json'; // import JSON data | ||
|
||
// Custom Tooltip component | ||
const CustomTooltip = ({ active, payload, label }) => { | ||
if (active) { | ||
return ( | ||
<div style={{ backgroundColor: 'rgba(255,255,255,0)', border: 'none', boxShadow: 'none' }}> | ||
<p>{`Date: ${label}`}</p> | ||
<p>{`Duration: ${payload[0].value}`}</p> | ||
</div> | ||
); | ||
} | ||
return null; | ||
}; | ||
|
||
function ProvingTimeAreaChart() { | ||
return ( | ||
<AreaChart width={750} height={400} data={data} margin={{ top: 20, right: 40, left: 100, bottom: 50 }}> | ||
<defs> | ||
<linearGradient id="colorDuration" x1="0" y1="0" x2="0" y2="1"> | ||
<stop offset="5%" stopColor="#fcba03" stopOpacity={0.8}/> | ||
<stop offset="55%" stopColor="#fcba03" stopOpacity={0}/> | ||
</linearGradient> | ||
</defs> | ||
<XAxis dataKey="name" axisLine={false} height={50}> | ||
<Label value="Date" position="insideBottomLeft" offset={-5} /> | ||
</XAxis> | ||
<YAxis axisLine={false} width={80}> | ||
<Label value="Proving Time" angle={-90} position="center" offset={20} /> | ||
</YAxis> | ||
<CartesianGrid vertical={false} strokeDasharray="3 3" /> | ||
<Tooltip content={<CustomTooltip />} /> | ||
<Legend /> | ||
<Area type="monotone" dataKey="duration" stroke="#fcba03" fillOpacity={1} fill="url(#colorDuration)" /> | ||
</AreaChart> | ||
); | ||
} | ||
|
||
export default ProvingTimeAreaChart; |
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,40 @@ | ||
import { AreaChart, Area, XAxis, YAxis, Tooltip, Legend, CartesianGrid, Label } from 'recharts'; | ||
import data from '../public/benchmarks/proof-verifying.json'; // import JSON data | ||
|
||
// Custom Tooltip component | ||
const CustomTooltip = ({ active, payload, label }) => { | ||
if (active) { | ||
return ( | ||
<div style={{ backgroundColor: 'rgba(255,255,255,0)', border: 'none', boxShadow: 'none' }}> | ||
<p>{`Date: ${label}`}</p> | ||
<p>{`Duration: ${payload[0].value}`}</p> | ||
</div> | ||
); | ||
} | ||
return null; | ||
}; | ||
|
||
function VerificationTimeAreaChart() { | ||
return ( | ||
<AreaChart width={750} height={400} data={data} margin={{ top: 20, right: 40, left: 100, bottom: 50 }}> | ||
<defs> | ||
<linearGradient id="colorDuration" x1="0" y1="0" x2="0" y2="1"> | ||
<stop offset="5%" stopColor="#fcba03" stopOpacity={0.8}/> | ||
<stop offset="55%" stopColor="#fcba03" stopOpacity={0}/> | ||
</linearGradient> | ||
</defs> | ||
<XAxis dataKey="name" axisLine={false} height={50}> | ||
<Label value="Date" position="insideBottomLeft" offset={-5} /> | ||
</XAxis> | ||
<YAxis axisLine={false} width={80}> | ||
<Label value="Verification Time" angle={-90} position="center" offset={20} /> | ||
</YAxis> | ||
<CartesianGrid vertical={false} strokeDasharray="3 3" /> | ||
<Tooltip content={<CustomTooltip />} /> | ||
<Legend /> | ||
<Area type="monotone" dataKey="duration" stroke="#fcba03" fillOpacity={1} fill="url(#colorDuration)" /> | ||
</AreaChart> | ||
); | ||
} | ||
|
||
export default VerificationTimeAreaChart; |
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 |
---|---|---|
@@ -1,10 +1,21 @@ | ||
import { Steps } from 'nextra-theme-docs' | ||
import SimpleBarChart from '../components/SimpleBarChart' | ||
import ProvingTimeAreaChart from '../components/ProvingTimeAreaChart' | ||
import VerificationTimeAreaChart from '../components/VerificationTimeAreaChart' | ||
import ProofSizeAreaChart from '../components/ProofSizeAreaChart' | ||
|
||
# Benchmarks | ||
|
||
Add proving & verification benchmarks here | ||
## Proving Time Benchmarks | ||
<div style={{ display: 'flex', justifyContent: 'center', padding: '40px 0' }}> | ||
<ProvingTimeAreaChart /> | ||
</div> | ||
|
||
## Verification Time Benchmarks | ||
<div style={{ display: 'flex', justifyContent: 'center', padding: '40px 0' }}> | ||
<VerificationTimeAreaChart /> | ||
</div> | ||
|
||
## Proof Size Benchmarks | ||
<div style={{ display: 'flex', justifyContent: 'center', padding: '40px 0' }}> | ||
<SimpleBarChart /> | ||
<ProofSizeAreaChart /> | ||
</div> |
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
[ | ||
{ "name": "Example Date", "duration": 372183} | ||
] | ||
[{"name":"Benchmark 2023-8-5","duration":37},{"name":"Benchmark 2023-8-6","duration":38}] |
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 @@ | ||
[{"name":"Benchmark 2023-8-5","size":37},{"name":"Benchmark 2023-8-6","size":38}] |
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 @@ | ||
[{"name":"Benchmark 2023-8-5","duration":37},{"name":"Benchmark 2023-8-6","duration":38}] |
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,21 @@ | ||
module.exports = (request, options) => { | ||
return options.defaultResolver(request, { | ||
...options, | ||
packageFilter: (pkg) => { | ||
// When importing snarkyjs, we specify the Node ESM import as Jest by default imports the web version | ||
if (pkg.name === 'snarkyjs') { | ||
return { | ||
...pkg, | ||
main: pkg.exports.node.import, | ||
}; | ||
} | ||
if (pkg.name === 'node-fetch') { | ||
return { ...pkg, main: pkg.main }; | ||
} | ||
return { | ||
...pkg, | ||
main: pkg.module || pkg.main, | ||
}; | ||
}, | ||
}); | ||
}; |
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,23 @@ | ||
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
verbose: true, | ||
preset: 'ts-jest/presets/default-esm', | ||
testEnvironment: 'node', | ||
globals: { | ||
'ts-jest': { | ||
useESM: true, | ||
}, | ||
}, | ||
testTimeout: 1_000_000, | ||
transform: { | ||
'^.+\\.(t)s$': 'ts-jest', | ||
}, | ||
resolver: '<rootDir>/jest-resolver.cjs', | ||
transformIgnorePatterns: [ | ||
'<rootDir>/node_modules/(?!(tslib|snarkyjs/node_modules/tslib))', | ||
], | ||
modulePathIgnorePatterns: ['<rootDir>/build/'], | ||
moduleNameMapper: { | ||
'^(\\.{1,2}/.+)\\.js$': '$1', | ||
}, | ||
}; |
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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.