Skip to content

Conversation

@yelhousni
Copy link
Collaborator

@yelhousni yelhousni commented Aug 5, 2025

Description

This PR corrects comments (URL to EFD forumulas) and saves 2m in Jacobian doubling and 3m in extended Jacobian mixed doubling.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

Current tests pass.

How has this been benchmarked?

e.g. BLS12-381 on MBA M1:

benchmark                  old ns/op     new ns/op     delta
BenchmarkG1JacDouble-8     338           298           -11.76%

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@yelhousni yelhousni added this to the v0.10.0 milestone Aug 5, 2025
@yelhousni yelhousni requested review from Copilot and gbotrel August 5, 2025 20:14
@yelhousni yelhousni self-assigned this Aug 5, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes elliptic curve point operations by implementing more efficient algorithms for Jacobian doubling and extended Jacobian mixed doubling operations, resulting in performance improvements of 2m (multiplication) for Jacobian doubling and 3m for extended Jacobian mixed doubling. Additionally, the PR corrects comment URLs to reference the proper EFD (Explicit-Formula Database) formulas and adds computational cost annotations to document the complexity of each operation.

Key changes include:

  • Replacement of existing Jacobian doubling implementation with a more efficient algorithm (saves 2m)
  • Optimization of extended Jacobian mixed doubling operations (saves 3m)
  • Correction of EFD formula URLs in comments to point to the correct references
  • Addition of cost annotations (~Cost: XM + YS) for better documentation of operation complexity

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

File Description
internal/generator/ecc/template/point.go.tmpl Template file containing optimized algorithms and corrected URL references
ecc/*/g1.go Generated G1 curve implementations with optimized doubling operations
ecc/*/g2.go Generated G2 curve implementations with optimized doubling operations
Comments suppressed due to low confidence (1)

internal/generator/ecc/template/point.go.tmpl:961

  • The comment incorrectly references 'double' instead of 'doubleMixed'. This should be updated to maintain consistency with the corrected comment pattern used elsewhere in the PR.
	t1.Double(&res)

@yelhousni yelhousni merged commit 77809ab into master Aug 5, 2025
7 checks passed
@yelhousni yelhousni deleted the perf/double branch August 5, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants