Skip to content

Instantly share code, notes, and snippets.

@LCamel
Created April 21, 2023 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LCamel/f9f1c377af8dd6aba48f2c68ae9ce80e to your computer and use it in GitHub Desktop.
Save LCamel/f9f1c377af8dd6aba48f2c68ae9ce80e to your computer and use it in GitHub Desktop.
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")
}
% 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