itch.io is community of indie game creators and players

Devlogs

Lightweight!

#randomicon
A browser #randomicon made in HTML5

If you ever tried #randomicon in a low-end device, you may have encountered some awkward gray screens and possibly had a lag-ish experience. Don't feel bad about it, because it was all my fault... And I finally fixed it! Here comes a huge optimization patch!

#randomicon, in its very nature, has to deal with over 3000 different icon images on every button press. Unsurprisingly, this created a bottleneck for image memory usage (taking up RAM), as all the possible images had to be loaded full-time in order to randomize properly. Although, this only happened because all the images were packed in a single asset. I knew it was not the greatest idea, but the app was pretty stable already, so I decided to publish it anyway and address this issue later.

Now, instead of a single asset, icons are split into small "chunks" (as I've been calling them) which are loaded dynamically. This way, when you click for new icons, the system loads just the chunks needed and wipes the unnecessary ones from memory. Meanwhile, the animations are helping "hide" the loading process to prevent FPS loss. At first, it doesn't sound much, but look how far we came.

#randomicon is now more than 13 times nicer with your RAM! Besides that, the little "max" is there to illustrate just the worst-case scenario. Most times it won't even take that much memory!

Along with the big rework above, this update also features a few minor changes.

Changes

  • Icons are now organized in chunks
    • Smaller image memory usage
    • File size is also a little lighter
    • Loading screen should be a bit quicker
  • Loading screen now shows the loading process
  • Animation times were tweaked
  • Ultrawide resolutions are now supported
  • Duplicates will no longer happen on randomization

I am really happy about all this, hope you enjoy it as well!

Try it now!

Leave a comment