lukejacksonn / perflink

Low friction JavaScript benchmarks that you can share via URL
https://perf.link
1.21k stars 43 forks source link

Use compression when encoding state #41

Open haggen opened 1 year ago

haggen commented 1 year ago

I came across this package json-url that focuses on encoding JSON objects to URL compatible strings and one of the key points is that it compresses the final string using LWZ.

On a cursory test it managed to reduce an encoded state from 5490 to 3536 bytes (~1.5x). You can check it out: https://codesandbox.io/s/musing-meadow-iwu4ci?file=/src/index.js

If you find that's something worth pursuing I'd be happy to send a PR your way, just let me know.

Cheers!

haggen commented 1 year ago

Or better yet, JSONCrush seems to produce even smaller results. 1968 bytes or 2.7x smaller.