Skip to content

perf(2-chain/varScalarMul): use DoubleAndAdd to reduce #constraints#706

Merged
yelhousni merged 1 commit into
developfrom
perf/scalarMul-2chain
May 29, 2023
Merged

perf(2-chain/varScalarMul): use DoubleAndAdd to reduce #constraints#706
yelhousni merged 1 commit into
developfrom
perf/scalarMul-2chain

Conversation

@yelhousni
Copy link
Copy Markdown
Contributor

@yelhousni yelhousni commented May 29, 2023

While looking into a question about emulated ScalarMul, I noticed we can further merge some Double+ Add into a DoubleAndAdd to reduce the number of constraints. Hence the tiny PR.

  • Old
BenchmarkVarScalarMulG1
    g1_test.go:460: groth16 1548
BenchmarkVarScalarMulG1/plonk
    g1_test.go:471: plonk 3861
BenchmarkVarScalarMulG2
    g2_test.go:496: groth16 4250
BenchmarkVarScalarMulG2/plonk
    g2_test.go:507: plonk 12604
  • New:
BenchmarkVarScalarMulG1
    g1_test.go:460: groth16 1544
BenchmarkVarScalarMulG1/plonk
    g1_test.go:471: plonk 3858
BenchmarkVarScalarMulG2
    g2_test.go:496: groth16 4240
BenchmarkVarScalarMulG2/plonk
    g2_test.go:507: plonk 12579

@yelhousni yelhousni requested a review from ivokub May 29, 2023 13:20
Copy link
Copy Markdown
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@yelhousni yelhousni merged commit ff596b2 into develop May 29, 2023
@yelhousni yelhousni deleted the perf/scalarMul-2chain branch May 29, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants