Execution speed with create variable library

video

when i create a bunch of variables AND when i am in the variable category blocks, it's laggy to create variable (about 2000 ms). If i'm on another category blocks, everything works normally (no big delay, about 200 ms)

project

Pretty sure it's because of rendering. It tries to render the new variables when they get created. It only happens in the variables category because that's the only category that needs to render the new variables.

Yeah, also, i've try to put the variable creation in a wrap: same result: long delay to create those variables...

That shows that it all has to do with rendering the new variables.

FYI I'm not getting a noticeable delay when creating variables in my biggest project but maybe you have a lot more than me

All these variables are created with this block ? (from create variables library)
image

Well, Jens has said MANY times not to use that block so maybe he has deliberately slowed it down :slight_smile:

maybe adding something in the left panel take some time because the slowness problem does not occur when I am not in the variables tab

haha

if I check the single palette option, it takes 5 seconds to execute...

It's a palette refresh issue.

Yup,. I even found the code that tells it to refresh the palette when you create a new variable. Snap/extensions.js at b611c6b9dea0e65c0a507d6083969856b93d3baa · jmoenig/Snap · GitHub