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
Compiler error when altering ecmult generation #533
Comments
Ok, the reason is that we are using the default |
@cryptoquick in general I recommend you edit
I think that's a complete list but I can't promise :) |
Alternately, I'd suggest using the upstream library directly and running its benchmarks, and then trying to port things back to this lib if you find improvements. |
I tried that, but it unfortunately threw more errors. I think it's related to the changes @apoelstra mentioned. In the code I linked to, I was indeed making the changes to build.rs, and while other changes took effect, the window size change does not, but results in the error I originally posted. I wonder if a crate feature could be added to support changing the window size, similar to lowmemory? |
If you have a use case I'd be happy to make this configurable at compile time. Maybe not with a feature flag (it's unclear how that'd interact with |
I was just curious if changing it would result in a performance improvement, since I believe that was indicated in the comments. |
Heh, I wouldn't be surprised if I wrote something like "higher == better" in the comments, but I've never tested this, and sipa says that it's untrue (in the issue you filed on libsecp). If you're just experimenting I'd recommend you just edit build.rs locally and then use |
sipa is correct (of course), but he meant precision bits, not window size. I can test prec bits easily enough and setting it to 8 does reduce performance by about 50%. I'd be curious if that were still true at higher window sizes, however, I can't get those changes to compile. |
Maybe you need to make the equivalent changes upstream, build there, then copy the resulting precomp files into this library? |
I tried that also, like this:
I get this error:
|
Right, you can't directly build the libsecp that's bundled with this library because it doesn't have context_create. You need to do this upstream. |
I'll admit, I'm not quite sure how to do that... |
In libsecp256k1, build with a larger window size. Copy |
Could we re-generate them based on |
It'd be fine to unconditionally regenerate them, they're not super slow, the problem is that I don't know how to make cc-rs do it :) |
I'm trying to compile a performant version of this library for testing on my local machine. I experimented with the following changes:
https://github.com/rust-bitcoin/rust-secp256k1/compare/master...cryptoquick:rust-secp256k1:perf?expand=1
And got this error:
I tried doing as it says, via
rm secp256k1-sys/depend/secp256k1/src/precomputed_ecmult.c
, but that only results in this error:How can I resolve this error, and are there any other performance optimizations I can make use of?
Not sure if it's helpful to mention or relevant, but for what it's worth, I'm building on a Zen 2 AMD system running Arch Linux with 128GB of DDR4.
The text was updated successfully, but these errors were encountered: