News for hackers. Stuff that matters.
Re:Ask HN: When did comments start being split across pages? by EGreg on Wednesday March 08, 2017 @02:45PM (#13823084)
Just out of curiosity, how do you crush a site with just posting maybe 100 text based comments on the top 20 items or whatever?

I mean what exactly is the load that causes this?

If you are executing some algorithm for each request - stop. Just run it every minute to rebuild a cache. HN discourages rapid fire replies anyway.

How hard is it to simply build an html fragment from a tree and cache it? You just see what nodes need other nodes to be appended.

OK, I can imagine MAYBE the most intensive thing is the votes and re-ordering of replies.

First of all I hope you are using this algorithm: https://medium.com/hacking-and-gonzo/how-reddit-ranking-algo...

Secondly, seriously once again you can batch the upvotes by thread and then process them during the recalculation phase. You only need to recalculate weight totals for the threads where there were upvotes - and this can be parallelized.

Re:Ask HN: When did comments start being split across pages? by pvg on Wednesday March 08, 2017 @03:16PM (#13823387)
some algorithm for each request - stop. Just [...] How hard is it to [...] OK, I can imagine MAYBE

It can't be any harder than not coming off blithely condescending.

Re:Ask HN: When did comments start being split across pages? by EGreg on Wednesday March 08, 2017 @03:34PM (#13823523)
Not condescending at all. Incredulous.

That's because the solution is straightforward, the people who built it are smart, had years to do it.

If I can build the basic scalable submission and comment system in one 8 hour day I am sure they can fix it in less than that.

Then you need to iterate of course and get the bugs out. But come on. I am incredulous that HN is buckling under a load of 20 stories with on average 100 comments each. Seriously?

Re:Ask HN: When did comments start being split across pages? by dang on Wednesday March 08, 2017 @05:05PM (#13824301)
The solution isn't straightforward because the problem isn't straightforward. It just looks like it is, which is by design.

The problem isn't straightforward because the software does a ton of things to try to keep the site good. We do a lot of manual moderation too, but anything we can write code for, we of course do.

Re:Ask HN: When did comments start being split across pages? by pvg on Wednesday March 08, 2017 @04:05PM (#13823773)
If I can build the basic scalable submission and comment system in one 8 hour day

...

[unless this is deliberate parody in which case, you got me]

Re:Ask HN: When did comments start being split across pages? by EGreg on Wednesday March 08, 2017 @04:06PM (#13823783)
of what
Re:Ask HN: When did comments start being split across pages? by pvg on Thursday March 09, 2017 @01:56AM (#13827576)
It feels like joke-explaining because it is but "I can implement this in a weekend" is one of the central self-unaware brogrammer cliches. You asked.
Re:Ask HN: When did comments start being split across pages? by EGreg on Thursday March 09, 2017 @09:52AM (#13829613)
Everything I say is self-aware and the result of reflection before posting.

And btw I said 8 hours, not a weekend.

Look up Poe's Law.

Re:Ask HN: When did comments start being split across pages? by iDemonix on Wednesday March 08, 2017 @07:30PM (#13825453)
It's comments like this that fuel my drive to earn HN points so I can get the downvote button.
Re:Ask HN: When did comments start being split across pages? by tradersam on Friday March 10, 2017 @04:04PM (#13842113)
I'm with you. The annoying part is it is quite unobvious to find out how much karma you need for specific functions to open up.
Re:Ask HN: When did comments start being split across pages? by krapp on Wednesday March 08, 2017 @07:34PM (#13825499)
>I mean what exactly is the load that causes this?

For one thing, other forums would use a database, whereas (from what I understand, but don't necessarily comprehend) Hacker News uses Lisp objects in memory, and flat files. We know how simple it might be to refactor in, say, PHP or Node but who knows what kind of eldritch Lisp weirdness this thing has going on under the hood?