-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Continuing from: piscinajs/piscina#108 (comment)
The GC can still move things to the old generation during synchronous calls, can't it? From what I know, minor collection cycles are triggered by growth in new space allocations, not by time. If streaming rendering vs synchronous rendering generate roughly the same amount of garbage plus or minus some promises and stream chunks, then they should promote roughly the same amount to the old space and cause roughly the same amount of slow major collections. What am I missing? Streaming rendering should also let the heap bloat less because chunks can be flushed and GC'd before the whole render is complete?
The above is not correct. The problem is that those objects lives longer, therefore they have a higher chance of getting moved to old space. This happens a lot. In most cases of synchronous renderToString()
, everything gets collected before receiving any other data.
I also think you are still prioritizing lower server costs over TTFB which compromises the experience and I think if that's the case someone who cares should benchmark and prove that it really does lower server costs and we should trade away experience for it.
We are not in agreement. From my experience most of the React SSR lowers the end user experience under high pressure as the CPUs are gets extremely busy and the event loop overloads. A renderToString with a 100ms event loop block would easily become a 150-200ms event loop block using streams, e.g from to 10 to 5 req/s. Simply put, it increases the chances of receiving more requests than the server can handle. I'm basically worried about the 99.9% latency percentile.