TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
871 stars 229 forks source link

Make decoding of base64 data URIs faster #269

Closed connor4312 closed 5 months ago

connor4312 commented 5 months ago

I saw in https://github.com/microsoft/vscode-js-debug/issues/1911 that base64 decoding of a data URI was taking a bit of time.

This PR feature-detects the presence of a global Buffer to use native decoding when running in Node.js, which is about 25x faster on a 10MB data URI than the JS implementation in the library.

I have a bit of a hack in order to test both paths when running tests, happy to change it if desired :)

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: 2f5fd05b201b40f173bc79516a24311d71fa4f18

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------ | ----- | | data-uri-to-buffer | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proxy-agents ✅ Ready (Inspect) Visit Preview Jan 6, 2024 9:30pm
TooTallNate commented 5 months ago

Thanks!