Make watchers update immediately when their value is changed

I HATE that watchers have a delay when their values are changed. Could you change them so they update immediately when their value changes?

Variables' values change all the time as your code is running (unless of course you're doing functional programming). If every time you change the value of a variable we stop running your code in order to do a redisplay cycle, your code will run very slowly.

If you want to experiment with this, try putting a WAIT 0 SECS after every SET. That will yield from that thread, and if no other threads are waiting to run it'll do a redisplay cycle.

I mean this:
Screen recording 2021-07-21 9.11.36 PM

Oh. I'd have to look into that, but my guess is that it's more or less the same answer: We don't want everything else to grind to a halt while you're sliding that slider. Jens is a big believer in the idea of a "lively" programming environment, which means that you can do things like drag a block into a running script and have the script's behavior immediately change. That means everything happening at once, and we have to keep up quick response to everything, and that means not letting any one thing dominate.

But I'll ask.

quick inspection of the source code suggests that watchers are updated once every 500ms
image

It might be possible to override that by changing the watcherUpdateFrequency using JS

But, it will slow down the real program like Brian says

If you prefer Scratch, just use Scratch. Don't whine about it on the Snap! forums.

Snap*!* isn't very fast. Scratch is different story. :expressionless:

Jens worries a lot about speed, but I figure, Snap! is the fastest block language with lambda, which for me is a sine qua non, so I don't worry so much about speed. :~)

You're right :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.