4 ms·
Not sure why you are being down voted, sending binary data is a well known issue with JSON, and base64 can be pretty costly if using a naive implementation. In
by dguaraglia 7y ago
Not sure why you are being down voted, sending binary data is a well known issue with JSON, and base64 can be pretty costly if using a naive implementation.
In a previous life I inherited a service that shipped tons of data (billions of requests a week) as base64 encoded protobuf strings over HTTP. It was a bad solution in so many ways, but there were historical reasons why it had gotten there. The system required a number of servers and I decided to do some profiling to see if there were some quick gains that could be made. As it turns out, about 60% of CPU time was spent decoding base64 using Python's standard library. I was shocked.