Hacker News new | ask | show | jobs
by jrockway 5997 days ago
Processes really don't take up that much memory and typically you're reusing a small number of them over and over anyway.

They take up several orders of magnitude more memory than lightweight threads. I did some benchmarks a few months ago showing this; check searchyc if you care. Edit: here you are: http://news.ycombinator.com/item?id=794409

Anyway, when you start thinking about "web applications" instead of "web pages", lightweight threads make a lot more sense. And, you'll find that treating a web application like it's just a bunch of web pages leads to many problems down the road. (Performance is the least of your worries.)

Finally, "I definitely don't need to know about this abstraction because my favorite language doesn't have it" is dangerous thinking.

1 comments

> They take up several orders of magnitude more memory than lightweight threads.

Premature optimization; when a 1st grader can count to the number of processes you need for large scale web application optimizing it any more is a waste of time and effort.

> You'll find that treating a web application like it's just a bunch of web pages leads to many problems down the road.

Really? I find it refreshingly helpful. Instead of your large application being a large application, it actually just a series of very small applications. If a page crashes, it's pretty much no harm at all. If your whole application crashes, you're screwed. You want to add some functionality, just add it on.

> Finally, "I definitely don't need to know about this abstraction because my favorite language doesn't have it" is dangerous thinking.

"Oooh shiny" is also dangerous thinking. Is it really better to waste your time using up as many threads as possible or actually solving real problems for a few hundred processes?

Sidebar: Why is always you, Jonathan Rockway? Just how many posts do you make on Hacker news in a day? :)