Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add a way to send a pre-encoded string as a text frame over a WebSocket #27129
In the vm-service, we have have some large (tens of megabytes) responses that are constructed in C++ and efficiently moved to the service isolate without copying as an external Uint8List. Unfortunately, the current WebSocket API doesn't have a way to send a text frame without converting this Uint8List into a String (UTF8 decode), which the WebSocket implementation then converts back to Uint8List (UTF8 encode). The 3x space overhead of the round-trip conversion can be fatal in memory-constrained environments like iOS.
A possible API change would be to add