Skip to content

perf: optimize PEM encoding and decoding#128

Merged
microshine merged 1 commit intoPeculiarVentures:masterfrom
aww-aww:bolt-pem-performance-15958313239831372340
Mar 18, 2026
Merged

perf: optimize PEM encoding and decoding#128
microshine merged 1 commit intoPeculiarVentures:masterfrom
aww-aww:bolt-pem-performance-15958313239831372340

Conversation

@aww-aww
Copy link
Copy Markdown
Contributor

@aww-aww aww-aww commented Feb 12, 2026

  • Optimize encodeStruct by using a simple loop for base64 splitting instead of complex logic. (47% faster)
  • Pre-compile rEolPattern regex for decodeWithHeaders to avoid recompilation in loop.

- Optimize `encodeStruct` by using a simple loop for base64 splitting instead of complex logic. (47% faster)
- Pre-compile `rEolPattern` regex for `decodeWithHeaders` to avoid recompilation in loop.

Co-authored-by: aww-aww <2776327+aww-aww@users.noreply.github.com>
@aww-aww
Copy link
Copy Markdown
Contributor Author

aww-aww commented Feb 12, 2026

Replacing the erroneously closed PR that had been approved.

@donskov
Copy link
Copy Markdown
Collaborator

donskov commented Mar 16, 2026

I like the changes. @microshine Needs your opinion.

@donskov donskov requested a review from microshine March 18, 2026 14:37
@microshine microshine merged commit 5e368b1 into PeculiarVentures:master Mar 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants