Releases: portsicle/portsicle-client
v1.2.0
Sending less bytes over the wire - LZ4 compression of response body.
I tested lz4 on a simple React project and found that compression significantly reduces the message size.
client logs:
❯ go run main.go http -p 3000
2025/02/23 15:30:40 Connected to remote server.
2025/02/23 15:30:40 Your public url: http://127.0.0.1:8888/pWWun4-PjRuWx
2025/02/23 15:30:44
HTML:
uncompressed: 1035bytes
compressed: 912 bytes
-----------------------------------
JS:
uncompressed: 389554bytes
compressed: 180138 bytes
-----------------------------------
CSS:
uncompressed: 20607bytes
compressed: 7912 bytes
server logs:
2025/02/23 15:30:39 Starting server on port 8888
2025/02/23 15:30:40 New client connection established with session ID: pWWun4-PjRuWx
2025/02/23 15:30:44 received compressed html: 912 bytes
2025/02/23 15:30:44 after uncompression: 1035 bytes
2025/02/23 15:30:44 received compressed js: 180138 bytes
2025/02/23 15:30:44 after uncompression: 389554 bytes
2025/02/23 15:30:44 received compressed css: 7912 bytes
2025/02/23 15:30:44 after uncompression: 20607 bytes
I chose LZ4 because it focuses on compression and decompression speed than compression ratio. And it works very well on repetitive data (in our case, msgpack encoded 1s and 0s).
On the client side:
raw response -> msgpack encode -> lz4 compress -> tunnel
On the server side:
tunnel -> lz4 decompress - > msgpack decode -> raw response
1.1.2
Message Pack instead of json.
The messages exchanged between portsicle client and server are huge HTTP responses. To save serialization-deserialization time and bandwidth, we will be using Shamaton's implementation of Message Pack based on the performance benchmarks observed.
Benchmark Analysis
The following benchmarks highlight the performance improvements of using Message Pack over JSON:
❯ go run main.go
Original Data Size: 1320 bytes
Serialization Results:
----------------------
Standard JSON:
Serialized Size: 2206 bytes (167.12% of original)
Serialize Time: 17.168µs
Deserialize Time: 111.724µs
Total Time: 128.892µs
vmihailenco/msgpack:
Serialized Size: 1936 bytes (146.67% of original)
Serialize Time: 27.643µs
Deserialize Time: 50.538µs
Total Time: 78.181µs
shamaton/msgpack:
Serialized Size: 1846 bytes (139.85% of original)
Serialize Time: 17.816µs
Deserialize Time: 20.488µs
Total Time: 38.304µs
shamaton/msgpack is consistently the best performer overall, with both the smallest size and fastest total processing time.
1.1.1
Release 1.1.1 fixes the 1006 abnormal client connection closure by implementing a simple ping pong mechanism to keep the connection alive.
Fixes: portsicle/portsicle-server#1