-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: optimize atob and btoa performance #1464
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
base: master
Are you sure you want to change the base?
feat: optimize atob and btoa performance #1464
Conversation
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.
It should use unbound versions of methods like this. After that, please, check performance and show results since unbound methods will cause some slowdown.
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.
While we're at optimizations, would pre-allocating like output = Array.from({ length: string.length * 3/4 })
improve perf?
I understand. What I meant is that an engine/runtime might not infer how much memory needs to be allocated for the |
f32fc31
to
9be5d63
Compare
|
This reverts commit 9be5d63.
@zloirock Can the pr be merged? |
@Chanran you haven't fixed that was requested. Also, please, create array with |
Same to dankogai/js-base64#186, it might have performance issue like js-base64 when use atob or btob polyfill. So I create pr to optimize it.