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

feat: implement memory-copy only of G1Element and G2Element #364

Closed

Conversation

PastaPastaPasta
Copy link
Contributor

This implements a performant memory-only copy for G1Element and G2Element; I don't have benchmarks, but when we used this we saw significant performance improvements.

@hoffmang9
Copy link
Member

Now that we've completed some needed housekeeping, could you rebase so we can get a clean CI and get this in?

Thanks very much for your upstream!

-Gene

@@ -59,6 +59,7 @@ class G1Element {
GTElement Pair(const G2Element &b) const;
uint32_t GetFingerprint() const;
std::vector<uint8_t> Serialize() const;
G1Element Copy();
Copy link
Contributor

Choose a reason for hiding this comment

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

in C++, this functionality is implemented by copy constructors. I can't see a good reason to have this be a member function instead. But, if there is a good reason, it should at least be a const member function

@emlowe
Copy link
Contributor

emlowe commented Jun 15, 2023

Closing PR - this isn't required due to the implicit C++ copy constructors, which are already in memory (essentially a memcpy)

@emlowe emlowe closed this Jun 15, 2023
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.

4 participants