Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: avoid in place operator where ineffective #372

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

chokobole
Copy link
Contributor

Description

This commit enhances performance by utilizing the c = a op b style instead of c = a; c inplace-op b. While the former style is nearly as performant as the latter when a is movable, it becomes inefficient when operating on prime fields or points on elliptic curves that are not able to be moved. This change ensures better performance and readability, reducing 2 lines to 1. Note that irrelevant changes may occur due to this adjustment.

@chokobole chokobole force-pushed the perf/avoid-in-place-operator-where-ineffective branch from 6ab1f34 to 4056c5d Compare April 2, 2024 14:42
Copy link
Contributor

@dongchangYoo dongchangYoo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Insun35 Insun35 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@TomTaehoonKim TomTaehoonKim left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ashjeong ashjeong left a comment

Choose a reason for hiding this comment

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

I tried to only include small fixes/ changes related to the commit, yet there appears to be a lot of redundant or unneeded variables or calculations. Perhaps a separate pr may be needed to fix these.

tachyon/math/finite_fields/fp6.h Show resolved Hide resolved
tachyon/math/finite_fields/fp12.h Outdated Show resolved Hide resolved
tachyon/math/finite_fields/fp12.h Outdated Show resolved Hide resolved
This commit enhances performance by utilizing the `c = a op b` style instead of
`c = a; c inplace-op b`. While the former style is nearly as performant as
the latter when `a` is movable, it becomes inefficient when operating on
prime fields or points on elliptic curves that are not able to be moved.
This change ensures better performance and readability, reducing 2 lines to 1.
Note that irrelevant changes may occur due to this adjustment.
@chokobole chokobole force-pushed the perf/avoid-in-place-operator-where-ineffective branch from 4056c5d to edde91e Compare April 4, 2024 07:50
Copy link
Contributor

@ashjeong ashjeong left a comment

Choose a reason for hiding this comment

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

LGTM

@chokobole chokobole merged commit 3424346 into main Apr 4, 2024
3 checks passed
@chokobole chokobole deleted the perf/avoid-in-place-operator-where-ineffective branch April 4, 2024 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants