Log In  


While playing with the very handy picotool utility, I discovered that simply removing tabs on my well formatted code I was able to save 813 compressed bytes!!!

Seriously???

I've spent days trying to remove code, reshuffle stuff to save 50-100 bytes and simply making my code unreadable beats any of these optimizations??

:_[



It's just an artifact of how compression algorithms work...removing a bunch of characters is going to result in a smaller result, usually. It's not like it's a specific decision to penalize indentation.

Of course the best solution is to limit the scope of your project in the first place so that it stays under the limit, or refactor it to use less code to accomplish the same things, but here's something you could always do, and which I made the decision to do on one cart: publish your cart with an unindented version of the code, but include a comment at the top with a URL to the original, pretty code somewhere, so that people can still see it if they want to. It's a compromise, but if you really can't cut any more, it may be a viable solution.


The compression is completely unpredictable. I find it a very frustrating restriction.

Sometimes adding a space reduces the compressed size more than removing a line of code.

I don't know any way to optimize for it except by trial and error.


Well, at least, the good news is that I now have 800 compressed bytes to finish my game...

I'll certainly keep the advice of publishing the garbled version with a pointer to my Github repo.



[Please log in to post a comment]