← Back to context

Comment by cush

7 hours ago

GC can be very slow. Relying on it for control flow is a bold move

I don't think the control flow relies on GC.

The control flow stops because statements after `await new Promise(() => {});` will never run.

GC is only relied upon to not create a memory leak, but you could argue it's the same for all other objects.

as long as there's no leak interrupting a promise should be good for performance overall, not necessarily for the front-end but for the whole chain.

Not that very slow for web applications. Maybe for real time or time-sensitive applications. For most day to day web apps GC pauses are mostly unnoticeable, unless you are doing something very wrong