logoalt Hacker News

My fast zero-allocation webserver using OxCaml

122 pointsby noelwelshtoday at 10:45 AM42 commentsview on HN

Comments

int3traptoday at 6:18 PM

> In the steady state, a webserver would have almost no garbage collector activity

I recently wrote my own zero allocation HTTP server and while the above statement is possible to achieve, at some point you need to make a decision on how you handle pipelined requests that aren't resolved synchronously. Depending on your appetite for memory consumption per connection, this often leads to allocations in the general case, though custom memory pools can alleviate some of the burden.

I didn't see anything in the article about that case specifically, which would of been interesting to hear given it's one of the challenges I've faced.

show 1 reply
boltzmann-braintoday at 2:51 PM

it's a massive crime that decades into FP, we still don't have a type system that can infer or constrain the amount of copies and allocations a piece of code has. software would be massively better if it did - unnecessary copies and space leaks are some of the most performance-regressing bugs out there and there simply isn't a natural way of unearthing those.

show 6 replies
smartmictoday at 2:06 PM

From the article:

> I am also deeply sick and tired of maintaining large Python scripts recently, and crave the modularity and type safety of OCaml.

I can totally relate. Switching from Python to a purely functional language can feel like a rebirth.

show 2 replies
ttoinoutoday at 12:25 PM

Does it look like functional programming anymore ?

show 5 replies