-
Notifications
You must be signed in to change notification settings - Fork 385
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
Pull secp256k1 contexts from per-peer to per-PeerManager #1472
Pull secp256k1 contexts from per-peer to per-PeerManager #1472
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1472 +/- ##
==========================================
- Coverage 90.94% 90.94% -0.01%
==========================================
Files 75 75
Lines 41891 41899 +8
Branches 41891 41899 +8
==========================================
+ Hits 38097 38103 +6
- Misses 3794 3796 +2
Continue to review full report at Codecov.
|
3a4258c
to
2ab8814
Compare
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.
ACK 2ab8814
Instead of including a `Secp256k1` context per `PeerChannelEncryptor`, which is relatively expensive memory-wise and nontrivial CPU-wise to construct, we should keep one for all peers and simply reuse it. This is relatively trivial so we do so in this commit. Since its trivial to do so, we also take this opportunity to randomize the new PeerManager context.
Rebased. |
2ab8814
to
e6aaf7c
Compare
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.
re-ACK e6aaf7c
I was running some heap profiling on an LDK application and noticed we currently allocate a full secp context per peer, so figured I'd just remove it.
Instead of including a
Secp256k1
context perPeerChannelEncryptor
, which is relatively expensive memory-wiseand nontrivial CPU-wise to construct, we should keep one for all
peers and simply reuse it.
This is relatively trivial so we do so in this commit.
Since its trivial to do so, we also take this opportunity to
randomize the new PeerManager context.