Hacker News new | ask | show | jobs
by waps 4590 days ago
This is the same sort of argument that functional languages keep making. It can work in certain manufactured examples, but in practice it falls on it's face because of the amount of data you need to keep track of, and the features you're throwing out are not optional for the vast majority of problems. Even then, doing this will blow up the data size by necessity and you'll lose time, first to cache trampling, then to virtual memory.

And frankly, the moment you hit virtual memory, you won't even get to 10 qps anymore without an SSD, and 100 with an SSD.

Static serving is a trivial optimization, and like all such things, it has huge qualifiers, and only works in the case it's intended for. It will only have a speed advantage in the obvious, simple case. As soon as you want to use any sort of dynamic element, extra round-trips will kill whatever advantage you thought you had. If you actually have large amounts of repeating elements (e.g. a table of some sort, article list, pagination, ... what have you), the extra memory usage will kill your advantage.

1 comments

I have no idea what you're talking about. Functional languages are irrelevant to this conversation.

For 99% of personal blogs and a large number of "mom-and-pop" business sites, you'd be lucky to find >1000 individual webpages on their site, each less than 100kB in size. MMAP to your heart's content... 100MB can easily be kept permanently in memory.

None of those "dynamic" elements you mentioned are difficult to do statically: You render once using a template language by iterating through and rendering each page in your sitemap. This handles most "dynamic" content you mentioned: tables, tags, tagclouds, pagination, related posts, etc. Using Jekyll or Hyde, you're talking ~100ms per post -- or 1.5 minutes to render 1000 pages. (In fact, Hyde used to use Django under the hood to do the rendering!)

I can definitively say, it's a big win for most personal websites -- most dynamic elements can be done at "compile time", others are covered by 3rd party services using client-side JS (eg. Disqus for comments), and if you need any others you should switch to a dynamic site. Tom Preston-Werner (github CEO) agrees with me; that's why he developed Jekyll for github [1]. Github pages are hardly a "manufactured" example, and they do work well in practice.

[1] http://tom.preston-werner.com/2008/11/17/blogging-like-a-hac...