We have a payload of 4MB to be returned to the client. We compress it to 500KB using gzip. Without compression, calculating the response and receiving it at the client end in the application, overall it takes 200ms. With compression, calculating the response and receiving it at the client end in the application, takes 190ms. The server spends 1 ms in the compression process, while the client spends 20 ms in decompression process. Even with a smaller data size, why would it take ~ a similar time over the wire for the data?
Edit: both client and server are implemented in kotlin.