Live data from Hacker News

Ask HN: Why and how is Hacker News so fast?

news.ycombinator.com

91–100 of 110 posts

Re: Ask HN: Why and how is Hacker News so fast?

#91

Without looking I can tell you it's two reasons: 1) It's text based and, therefore, can keep its total response small. 2) The page is cached on the backend so database lookups are kept infrequent and small. Those two reasons alone make it faster than, say, 80% of most web sites.

> Without looking You risk being wrong this way. Your #1 is OK, but #2 is false: there's no database (in the sense of RDBMS or NoSQL) behind HN. It's just plain files on disk. Which, of course, makes fetching data blazingly fast, thanks to how filesystems are already handled and cached by the OS. Anyway, I long suspected that "gzip and cache the hell out of your site" is not the best way to go about optimizing websit…

You risk being wrong this way. Unless you are involved in the site and can testify to that. In any case, the page could be, or should be, cached in some form, either on the server or with the browser.

Which makes me wonder with your second paragraph. gzipping and caching are the easiest and one of several ways to optimize the downloading of a web page. Server side code written in C plays no part in that except if the pages are created on the fly and anything else really does slow down delivery of the page; that is, page creation takes longer than 80ms or so, but a properly coded site won't let that happen if it can be helped.

And after running my own web dev business for 11 years, I didn't have to look at anything to determine any of that.

Re: Ask HN: Why and how is Hacker News so fast?

#92
post #18

If you want to see an even faster "forum", see http://forum.dlang.org/

Wow quiet fast indeed, in my experience the fastest dynamic site I browse is kickass torrents (=> no link for obvious reason) With cache enabled they both take less than 150ms to render a full page which actually should be a standard but seems really really faster than any sites I visit everyday

Re: Ask HN: Why and how is Hacker News so fast?

#93

HN pages are small, the HTML is generated on the server, and they render nearly progressively. That is, the renderer doesn't need to block waiting for many CSS, JavaScript, or font files to download. Most development practices considered "modern" prevent progressive rendering. Common tools like Bootstrap or Jquery, as normally used, cause page rendering to block until large libraries are downloaded, despite the fact…

"The largest reason of all is that most developers dismiss such concerns as old school worries and like to harp on and on about how tools like Angular enforce wonderful software engineering practices, ignoring that most such frameworks, as commonly used, bloat pages and cause incredible rendering delays."

Alternatively, you could say that many people look at the tradeoffs and decide they're comfortable with trading off a certain amount of speed for the user, in order to increase development speed.

Whether these people are right or wrong really depends on the context.

Re: Ask HN: Why and how is Hacker News so fast?

#94
post #93

HN pages are small, the HTML is generated on the server, and they render nearly progressively. That is, the renderer doesn't need to block waiting for many CSS, JavaScript, or font files to download. Most development practices considered "modern" prevent progressive rendering. Common tools like Bootstrap or Jquery, as normally used, cause page rendering to block until large libraries are downloaded, despite the fact…

"The largest reason of all is that most developers dismiss such concerns as old school worries and like to harp on and on about how tools like Angular enforce wonderful software engineering practices, ignoring that most such frameworks, as commonly used, bloat pages and cause incredible rendering delays." Alternatively, you could say that many people look at the tradeoffs and decide they're comfortable with trading o…

Users sitting on gigabit links close to the server make the tradeoffs, and people on a high latency end of a 3G link, or an airport wifi with a weak signal and 50% packet loss need to live with those tradeoffs.

Re: Ask HN: Why and how is Hacker News so fast?

#95
post #45

It's relatively straightforward. Take a look at what Pingdom tells you it does when the site loads: http://tools.pingdom.com/fpt/#!/cnYAuq/https://news.ycombina... 5 requests, Total size 12.6kB, total time 661ms. 1 request for the content, 1 for css, and then 3 gifs, all from a single domain (so just one DNS request). If you look at the profile, 47% of the time was spent doing that one DNS lookup, so subsequent reque…

Might be able to get that down to 5 requests if they use .pngs instead of .gifs and throw them into a sprite sheet.

Those gifs are less than 1kB each. Just include them in the CSS as base64. Or don't, doesn't matter for a site with such simple code anyway.

Re: Ask HN: Why and how is Hacker News so fast?

#97
post #28

Earlier quoted context omitted.

This one is crazy. How are they so fast?

No, forum.dlang.org is not crazy-fast. Other sites are crazy-slow. Write compact and easy-to-render HTML, it's no rocket science. Write some trivial CSS, you don't need Bootstrap. Make something dead-simple and call it flat design . If you have more than one stylesheet, concatenate them into one. Consider minifying. You don't need a 200 kB JS framework in order to fade in some hover menu. If you do need more than one…

Lot of good points, thanks.

>You don't need 2 MB worth of stock photos. Recently, there was a page on HN with an uncompressed 12 MB banner photo. That is insane.

That seems to be a big trend nowadays and a huge pain.

Re: Ask HN: Why and how is Hacker News so fast?

#98

Earlier quoted context omitted.

On the other hand, they do some stupid stuff, disregarding the standard and how useful it is [0]. [0] https://blog.cloudflare.com/deprecating-dns-any-meta-query-t...

Disregarding standards is not uncommon when you're actually running a high-performance system that faces attacks. Plenty of stuff goes into specs that just doesn't make sense while operating. Their explanation of why they are disabling ANY seems perfectly fine.

All I can see is that you've never needed to debug problems with DNS.

Re: Ask HN: Why and how is Hacker News so fast?

#99
post #56
post #9

Speed isn't everything. Hacker News has been recently one of the most unreliable website I frequent.

The whole point of this whole thread in a nutshell is that speed is greatly underrated. Besides this thread we had a bunch of "We discovered that adblockers clean up and speed up browsing experience by x%. Now why is that?" threads in the last month posted here. There's a reason for that. As for reliability... I don't have complaints, honestly. Maybe I spend less time here than you. My only gripe with HN is the searc…

Agree, it should be improved on mobile. I would love to hear more about your desktop experience, what would be the improvement you would love to see?

Re: Ask HN: Why and how is Hacker News so fast?

#100
post #93

Earlier quoted context omitted.

"The largest reason of all is that most developers dismiss such concerns as old school worries and like to harp on and on about how tools like Angular enforce wonderful software engineering practices, ignoring that most such frameworks, as commonly used, bloat pages and cause incredible rendering delays." Alternatively, you could say that many people look at the tradeoffs and decide they're comfortable with trading o…

Users sitting on gigabit links close to the server make the tradeoffs, and people on a high latency end of a 3G link, or an airport wifi with a weak signal and 50% packet loss need to live with those tradeoffs.

Sometimes, yes, in which case the tradeoff might not make sense.

But sometimes it does - e.g. I think in most cases, something existing but being slow is better than something not existing in the first place, which might be the case if the costs of making it go up.

Post reply on HN