92 points · by alexzeitler · 3y ago · 24 comments
https://web.archive.org/web/2/https://www.ycombinator.com/li...
Caching is a hard thing to get right. I try to use “vegeta attack” to load test pages as I make them, but the measurement is the problem. Unless you already have a profiling pipeline set up, it’s a bit hard to fix the issue quickly.
One trick is to comment out half the site in a binary fashion until it suddenly loads, then keep bisecting until it stops loading. It’s crude but only takes log(n) steps and can be done quickly. You’d have to do it in production, but it might be easier than guessing.
Edit: it's loading now. Great resource!
Frontpage right now = 35.67KB
This page is currently 18.34KB.
It's one of the only interesting sites left on the web that is 100% usable on 2G (EDGE) mobile data.
HN is the most responsive message board in the world. And by responsive I mean you feel the effect of upvotes and downvotes instantly. There is caching, but almost none of it is at the expense of the feel of the site. This is unlike Reddit, where although votes do have a quick effect, the algorithm is much simpler and less sensitive to sudden shifts in public opinion. On HN you can win and lose debates in a matter of minutes, and it’s thanks to the responsiveness that large websites seem not to have.
Still though, just 4 pages of js. I guess what I was thinking is typical insane tracking framework and tracking stuff.
https://github.com/gruseom/numen
There are also very few moving parts. In arc you have access to the entire stack from http request to http response, at the raw text level. The goal is simply to generate the text as quickly as possible. And racket turned out to be a good long term bet; people underestimate how optimized it is.