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??

:_[

P#46074 2017-11-09 16:07 ( Edited 2017-11-09 21:51)

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.

P#46077 2017-11-09 16:26 ( Edited 2017-11-09 21:26)

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.

P#46078 2017-11-09 16:29 ( Edited 2017-11-09 21:29)

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.

P#46079 2017-11-09 16:51 ( Edited 2017-11-09 21:51)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-19 03:17:02 | 0.005s | Q:10