Skip to content

Conversation

harrytmthy
Copy link
Owner

@harrytmthy harrytmthy commented Aug 26, 2025

Summary

Reduce first-use latency by pre-warming the BouncyCastle at process start.

Implementation Details

  • Add SafeBoxStartupProvider that asynchronously touches Cipher.getInstance("ChaCha20-Poly1305", "BC") on startup to warm JCA/BC.
  • Make cipherPool in ChaCha20CipherProvider lazy.
  • No public API changes.

Closes #69

@harrytmthy harrytmthy added this to the 1.2.0 milestone Aug 26, 2025
@harrytmthy harrytmthy self-assigned this Aug 26, 2025
@harrytmthy harrytmthy added enhancement New feature or request performance labels Aug 26, 2025
@harrytmthy harrytmthy merged commit cb4efe9 into main Aug 26, 2025
3 checks passed
@harrytmthy harrytmthy deleted the feature/prewarm-bc branch August 26, 2025 08:20
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre-warm JCA/BouncyCastle to remove first-use Cipher init latency
1 participant