Splitting an update call into two ones. Is it a slow-down?

Is calling f (much) faster, that sequential calling g and h directly from outside of the blockchain (from frontend, for instance)? All calls here are update calls.

As I understand, calling f may “compress” it into a single commit point, but if I call g and h separately, it is two commit points and so 1-2 sec more. Do I understand correctly?

func f(): async () {
  await g();
  await h();
}

“It depends”

The scheduler will decide if it has enough bandwidth to include h immediately or wait until the next round.

I think you should not depend on it either way and assume the scheduler behavior may change in the future…and it may be dependent on the future in subnet load.

I’ve seen plenty of examples where h “always” runs immediately, but, of course, if you build a loop and do it over and over, eventually an h will execute the next round(I get about 22 sequential executions on the same round on the playground with simple calculations.)

1 Like