logoalt Hacker News

cushtoday at 2:37 PM3 repliesview on HN

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


Replies

BlueGreenMagicktoday at 3:49 PM

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.

dominicrosetoday at 4:15 PM

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.

augusto-mouratoday at 4:03 PM

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