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

[optim - C binding] Use a contiguous array/flat representation for coordinates #241

Open
dannywillems opened this issue Jul 14, 2024 · 2 comments
Labels
enhancement New feature or request performance (potential) performance improvements

Comments

@dannywillems
Copy link

dannywillems commented Jul 14, 2024

At the moment, in the C bindings, the points are represented as a struct with 3 fields. It creates 3 indirections when calling the C code. When performing many operations on the same point, the same memory page, containing the 3 coordinates, can stay in the CPU cache, which may give a possible non-negligeable performance improvement.

@dannywillems dannywillems changed the title [optim [optim] Use a contiguous array for coordinates Jul 14, 2024
@dannywillems dannywillems changed the title [optim] Use a contiguous array for coordinates [optim - C binding] Use a contiguous array for coordinates Jul 14, 2024
@dannywillems dannywillems changed the title [optim - C binding] Use a contiguous array for coordinates [optim - C binding] Use a contiguous array/flat representation for coordinates Jul 14, 2024
@hannesm hannesm added enhancement New feature or request performance (potential) performance improvements labels Jul 15, 2024
@hannesm
Copy link
Member

hannesm commented Jul 15, 2024

This is about the elliptic curves (mirage-crypto-ec). This is a good idea, would you mind to submit a PR and have some performance numbers before&after (see bench/speed.exe)?

@dannywillems
Copy link
Author

dannywillems commented Jul 17, 2024

This is about the elliptic curves (mirage-crypto-ec). This is a good idea, would you mind to submit a PR and have some performance numbers before&after (see bench/speed.exe)?

I can not commit to anything for the next two weeks. Maybe beginning of August I will have some spare time.
More generally, I was curious about checking more the C related code to see if a flat representation in a single custom block can be used. A flat structure of a multiple of 64 bits can be used in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance (potential) performance improvements
Projects
None yet
Development

No branches or pull requests

2 participants