Btw. too bad author talks about microsecond guarantees usage but does not provide a link, that would be interesting reading.
Btw. too bad author talks about microsecond guarantees usage but does not provide a link, that would be interesting reading.
When data is immutable, it can be freely shared. Changes to the data essentially uses copy-on-write. And it only writes the delta change, since you don't need a deep copy due to immutability. Add that the garbage collectors of Haskell and Erlang are designed to work with a high allocation rate and have 0 cost for dead data, and this is much faster than what people think.
The way you implement a webserver in either Haskell or Erlang is rather trivial. Whenever there's an incoming request, you make a thread to handle it. So you don't have 1 webserver serving 10k requests. You have 10k webservers serving 1 request each. And since they are started from the same core data, they'll share that due to immutability. See also old-style Apache or PHP and fork().
Either you have a specialised GC that works like this, or probably a good general generational GC can pick up on this pattern on its own.