-
Couldn't load subscription status.
- Fork 1.1k
ecmult_multi: reduce strauss memory usage by 30% #1761
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
base: master
Are you sure you want to change the base?
Conversation
The current approach looks clean. What other approaches do you have in mind? |
| struct secp256k1_strauss_point_state { | ||
| int wnaf_na_1[129]; | ||
| int wnaf_na_lam[129]; | ||
| int8_t wnaf_na_1[129]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| int8_t wnaf_na_1[129]; | |
| int_least8_t wnaf_na_1[129]; |
This is technically better to retain support for platforms that don't offer int8_t. I don't think there are any relevant platforms of that kind, but why not... 🤷
edit: Now that I think about it again, a platform that does not offer int8_t will most likely one for which CHAR_BITS != 8. And then it's neither relevant nor it's likely to offer int32_t or int64_t which we need anyway. So I guess there's no difference between int8_t and int_least8_t.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically better to retain support for platforms that don't offer
int8_t.
int8_t is already used in src/assumptions.h.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my x86_64 system, this PR reduces the memory allocated on the scratch space from 2224 bytes to 1452 bytes per point.
Please ping me once it’s undrafted.
|
The current approach requires a temporary array
Both options seem to be worse. |
I might suggest a third option: hebasto@5c0d6ee. |
This is a draft because I'm not sure about the cleanest way to implement it.