3 ms·
"I’ve become extremely wary of allocating objects on the heap and of blocking the event loop." I always think of quotes like this when I hear people claim that
by olau 6y ago
"I’ve become extremely wary of allocating objects on the heap and of blocking the event loop."
I always think of quotes like this when I hear people claim that garbage collection is a solved problem.
- jerf 6y agoThis isn't really a garbage collection problem. Any runtime using the same basic code would allocate system-crushing amounts of RAM, which is a problem on its own regardless. This will cause other problems for other memory allocation techniques, such as this being a great recipe for fragmenting all of your RAM, and still having a fairly slow deallocation process due to sheer number of objects being churned. The real problem here is that where a streaming parse is called for, a parser that fully manifests all the objects in RAM was used. Streaming parsers remain relatively rare. (It's actually a legit advantage of the XML library infrastructure; they're readily available there, though typically you'll be using them directly because the libraries that build further layers of abstraction on parsing often concretely manifest everything in RAM anyhow....)