Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Not an issue) Decreasing binary size even more #3

Open
VincentFoulon80 opened this issue Nov 16, 2022 · 0 comments
Open

(Not an issue) Decreasing binary size even more #3

VincentFoulon80 opened this issue Nov 16, 2022 · 0 comments

Comments

@VincentFoulon80
Copy link

VincentFoulon80 commented Nov 16, 2022

Hello !

I recently forked your project to try to decrease the size of generated binaries. I went for a naive compression method consisting on counting how many characters to print before toggling to the other character. Due to the format having sometimes tens of thousands of the same character, I went of a stream of u32. The resulting integer stream would end up reducing the binary to about 3/4 of its current size.
I noticed the majority of the numbers could still fit in a u8 stream. So I decided to split overflowing numbers with a zero value between each chunk, creating more entries to the stream, but those entries took a quarter of their original size.
With this, I managed to reduce the binary size to 909 Ko (windows exe) so a bit less than 1/4 of the current binary size.

You can have a look at my fork here. If you want to integrate it to your repository I'll be happy to make a PR 😄
Note : Since I don't have Deno installed and also don't know well TypeScript I wrote my preloading script using PHP instead (tiny.php) to run it just type php -d memory_limit=-1 tiny.php.
Ideally we should write a build script for this.

Have a great day !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant