Created
April 21, 2023 06:57
-
-
Save LCamel/f9f1c377af8dd6aba48f2c68ae9ce80e to your computer and use it in GitHub Desktop.
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
import { poseidon } from "circomlibjs"; // 0.0.8 | |
import { poseidon2 } from "poseidon-lite"; // 0.2.0 | |
for (let j = 0; j < 5; j++) { | |
console.time("circomlibjs") | |
for (let i = 0n; i < 10000; i++) { poseidon([i, i + 1n]) } | |
console.timeEnd("circomlibjs") | |
console.time("poseidon-lite") | |
for (let i = 0n; i < 10000; i++) { poseidon2([i, i + 1n]) } | |
console.timeEnd("poseidon-lite") | |
} |
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
% node --version | |
v18.15.0 | |
% node a.mjs | |
circomlibjs: 6.015s | |
poseidon-lite: 4.285s | |
circomlibjs: 5.736s | |
poseidon-lite: 3.991s | |
circomlibjs: 6.105s | |
poseidon-lite: 4.006s | |
circomlibjs: 5.949s | |
poseidon-lite: 4.303s | |
circomlibjs: 5.899s | |
poseidon-lite: 3.937s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment