Peaches 'n' Stink

16,000 Comments on a Single Page

by stink on Aug 14, 2021 5:55pm to comments 16000 comments(4429)
Yesterday I invited people from HN to spam this forum. It looks like someone initially created a couple hundred spam comments manually. And then a different user dropped 16,000 spam comments (I assume with a script). Here's the post with all 16,000+ comments showing.

I was scared to view the post with all 16k comments because I thought it would crash the page. Years back I remember trying to view an HTML table with 10k rows on a single page and it brought the page to its knees. To my surprise 16k list items (ie. bullet points) seems to display fine.

The back-end is a lot of async Node.js and PostgreSQL, so I guess that can pull all 16k comments no problem. And all this is running on a $5 DO droplet.

One funny thing about this is that there probably would have been an issue at 17,576 comments. Each comment has a heirarchy path that is made up of 3 letter values (1 = aaa, 2 = aab ... 17,576 = zzz). You can actually see the function that converts ints to these three letter values. However, this probable 17k comment cap is per comment branch - so basically each post and comment can have 17k sub comments. So under normal circumstances if a post had say 100k comments it's very unlikely that the post or any single comment would have anywhere near 17k direct sub comments.
Showing all comments. Switch to locked.
more >