News for hackers. Stuff that matters.
Re:The Myth of Smart Pointers by vidarh on Friday December 01, 2023 @04:21AM (#38484824)
About 24 years ago I built a webmail service based on C++ cgi's. FastCGI existed, but that required perfect memory management. CGI let us do what your instructor did, and on one hand it saved us from dealing with leaks at all, and on the other it reduced the performance overhead of going for CGIs - much faster to deallocate the whole heap in one go.

We'd manually deallocate particularly big allocations, but otherwise we knew the process would die within fractions of a second anyway, so the increased memory use was fairly limited.

We served a couple of million users with that using servers with a combined capacity lower than my current desktop.

Re:The Myth of Smart Pointers by actionfromafar on Friday December 01, 2023 @07:17AM (#38485897)
C++ with CGI is weirdly like a fast PHP with the same teardown/clean slate property.
Re:The Myth of Smart Pointers by vidarh on Friday December 01, 2023 @10:34AM (#38487911)
It got surprisingly fast actually. We also did things like statically link it which drove the overhead of restarting down further (when the dynamic linker is a measurable proportion of your total execution time....), and I really liked knowing we had a fully clean slate on every request.

I mostly do Ruby these days, and the one thing I strongly dislike is the horribly slow startup...