tfausak / rattletrap

:car: Parse and generate Rocket League replays.
https://hackage.haskell.org/package/rattletrap
MIT License
150 stars 21 forks source link

Remove Aeson #246

Closed tfausak closed 2 years ago

tfausak commented 3 years ago

This pull request is an experiment to remove Aeson. Currently I'm using it to test Argo, a JSON library that I am writing. However it might make sense to try other libraries such as Waargonaut.

Why bother doing this at all? Well for starters I wanted a Real World ™️ project to test Argo against. But also I feel like Aeson brings in a fair amount of complexity for something that feels like it should be pretty simple. And more pragmatically, Rattletrap's Dictionary data type could be represented directly as a JSON object, but Aeson doesn't allow maintaining the order of the keys.

tfausak commented 3 years ago

As expected, this is a little slower than the baseline (about 10%):

Old: https://github.com/tfausak/rattletrap/runs/3914358564#step:8:353 New: https://github.com/tfausak/rattletrap/runs/3946532302#step:8:353

That's not too bad for an unoptimized library!

Also the resulting Linux binary is about half as big:

~/Downloads> ls -lh artifact/ubuntu-20.04/rattletrap
-rw-r--r--@ 1 taylor  staff   4.1M Oct 16 14:19 artifact/ubuntu-20.04/rattletrap
~/Downloads> ls -lh artifact-2/ubuntu-20.04/rattletrap
-rw-r--r--@ 1 taylor  staff   2.5M Oct 20  2021 artifact-2/ubuntu-20.04/rattletrap

And that's after running through UPX!

tfausak commented 3 years ago

Why bother doing this at all?

Also frustrated by #245.

tfausak commented 2 years ago

Closing this for now since it will have to change to accommodate https://github.com/tfausak/argo/pull/42 anyway.