Overhead of Running a New Effect in a React-Native App
How much overhead is there to run a new effect?
I'm profiling my react-native app (the hermes profiler is quite unreliable so this may be nothing) and I've noticed that running a simple sync effect takes more time than I would expect. As a bridge to react I run a sync effect to grab a service like so:
get Auth(): IAuthService { return EffectRuntimeCtx.getDefault()!.getServiceSync(AuthServiceTag) }
get Auth(): IAuthService { return EffectRuntimeCtx.getDefault()!.getServiceSync(AuthServiceTag) }
where
getServiceSync
getServiceSync
is simply
pipe(serviceTag, runSync(myRuntime))
pipe(serviceTag, runSync(myRuntime))
. That appears to take a non-trivial amount of time (a few ms). I'm going to memoize it but I'm curious about the expected amount of overhead to run* an effect.