So I’ve been having some real trouble with lag in my project(s) lately. There are literally so many blocks on the screen that it’s about a 50/50 chance that Snap! crashes my (school-issued) chromebook.
My teacher talked about block creation today, which prior to hearing about I hadn’t really touched yet, but it gave me a great idea! I’m not sure if this is common knowledge and I’m just now figuring this out, but by putting all of the blocks in a sprite into a single, or multiple, block heavily reduces the amount of lag whenever you load a page.
Although the window for the block will take a hot second to load, the tradeoff, for me, at least, is very much worth it.
You could skip this and put everything in a different sprite, but this can cause problems if you’re into making local vars instead of globally declaring everything.
I’ve noticed this as well, and is probably one of the easiest optimizations you can do. It also encourages making blocks, which is a really big part of snap.
They thought gathering demographics not related to Snap! is out of scope for this forum. I don't really know if this type of post is allowed, only we'll find out when a moderator officially declares the stance. Imagine posting a random survey not related to Snap! in a topic about an optimization trick. Wouldn't that appear a little bad form?
Going back to the original topic, I actually found this made a major difference when I was doing Advent of Code. I had so many obsolete scripts (and large in-use scripts) that it froze Snap for one “not responding → wait” cycle just to open the sprite. Running the project with that sprite open slowed things down by a factor of 2 at least, and I was already dealing with 15-30 minute runtimes.