bloznelis / typioca

Cozy typing speed tester in terminal
MIT License
750 stars 22 forks source link

Generated executable size #49

Closed andrewathalye closed 2 years ago

andrewathalye commented 2 years ago

Hello, I understand that it is common with Go programs, just as with Rust, to statically link dependencies, however I'd like to suggest a possible improvement that could be made: it seems that a lot of code involving encryption, decryption, and even some powershell scripts have been included and baked into the generated binary. On Linux, this results in a 6.5 MB executable. Compare, for contrast, the Fish shell, which is 1.7 or so MB.

I believe that a lot of code size could be saved by not importing crypto libraries, since after looking through strings they account for almost 75% of the generated strings (alongside long datetime errors and word lists stored in a json-like format).

bloznelis commented 2 years ago

Hello. Go is known for its big binaries. We need crypto libs for ssh server support and JSON word lists sizes are in kilobytes, so the difference would be negligible.

That being said, there are measures to alleviate large binaries: compressing the binary, dropping function names, targeting 32 bits arch instead of 64 bits etc. All of those come with some sort of compromise, and I think it's not worth it for a simple project like typioca.

bloznelis commented 2 years ago

Closing this for now. We might want to revisit this in the future.