Topic: [Feature Request] Limit visible comments in posts to prevent lag

Posted under Site Bug Reports & Feature Requests

(I don't know if this has been requested or discussed before so I apologize if this is a repost)

Upon opening a post with a large amount of comments (i.e. >100), I receive a lag spike while loading all the comments (lasting longer the more comments). I'm wondering if this is an issue for other users. If it is, I'd suggest limiting the initially visible comment count on posts to ~25-100 (could also be configurable in settings) and add a "show more comments" button, which would load more comments in similar intervals. Feedback appreciated.

post #2848682 (with 336 comments) loads in about 2 seconds for me... but maybe my download speed and device are just much better than average.

If it's added, the amount being configurable would be useful.

The real issue is it's having to parse the API, right? Not sure how the internals of that code works. If it was just text, then it would load instantly. Wonder if it's possible to cache comment divs at server end so it only loads a single object. I find it odd that it's even noticeably slower with that many comments as even my ancient Atom laptop seems to load pages fast enough.

As a convenience factor, if trying to read/save all the comments, it makes sense to default to showing them all (above a rating)? Come to think of it, could this be solved with custom CSS?

:edit: Oops, forgot that it also loads all those images. :P

furrin_gok said:
It's the year 2022. Text is practically zero strain on modern internet.

It's more than just text though, there's also rendering, downloading 300 thumbnails from the commenters avatars, etc.
But.. again it was pretty much still instant for me.

bitWolfy

Former Staff

Well, post #6268 (cheese grater) has 1267 comments, and it does take a little while to load.
Pagination is definitely a good idea.

I want to ask why that post has so many parents/children, but I don't think I want to know looking at the surviving images.

One thing that e6 could do is add a loading="lazy" HTML attribute to avatars. Then it won't actually download and render the images until you scroll to them, at least if the browser supports it.

Maybe even try setting it on the thumbs on search pages too. It's possible that the blacklisted thumbs won't load until/unless you make them visible.

  • 1