Description
Hermes offers builtin btoa, using it or vendoring react-native-quick-base64, will bring 10x+ improvement in the event processing time.
Things to consider
- Add
carrier.base64Polyfill to clearly separate the event processing logic and the use encoders (same as for utf8)
Use ~~String.fromCharCode~~ + ~~btoa~~ both natively supported by Hermes
- (Alternative) vendor JSI lib like react-native-quick-base64 to use
base64StringFromByteArray
- Solution could be also try to avoid the base64 encoding of the envelopes (maybe pass it as an object to the native layers, or as an array (note that we have ran into issue in the past with the array size (link TBA)))
Description
Hermes offers builtin
btoa, using it or vendoringreact-native-quick-base64, will bring 10x+ improvement in the event processing time.Things to consider
carrier.base64Polyfillto clearly separate the event processing logic and the use encoders (same as for utf8)Use+~~String.fromCharCode~~both natively supported by Hermes~~btoa~~base64StringFromByteArray