So, the Islamic Terrorist Opens Fire on Florida Nightclub; 50 Killed, 53 Wounded story is up over 400 comments and loading slower than hell. We finally managed to find ourselves a limit to comments under the current code. There's a fix going to be coming in the upcoming site update but for now there are two workarounds; take your pick.
The latter solution gives you 5-10 root level comments and all their children not 5-10 comments total. It also allows you to keep using the javascript expand/collapse buttons if you were.
(Score: 2) by Username on Tuesday June 14 2016, @03:48PM
s = seconds
Flat 7s first page
Improved Threaded 5s
Nested 7s first page
No Comments 1s
Threaded 5s
Based on Opera 12.15 page load timer.
(Score: 2) by The Mighty Buzzard on Tuesday June 14 2016, @04:01PM
Difficult to really test. Page render times on the live site doesn't take into account server load or whether the db had all the comments it was asked for already cached in ram or had to go to disk for them. Also, try it with max comments set to say 100 and you'll see a huge speed increase between Threaded and Nested and between Nested and Flat.
My rights don't end where your fear begins.
(Score: 2) by Username on Tuesday June 14 2016, @04:21PM
Eh, I think I have all the default settings, too lazy to change unless there is -1 I wanna see. So its choking on the database requests? Maybe if a thread is over X amount of posts make it a static page on a ram disk and have the script update that instead of db?
(Score: 2) by The Mighty Buzzard on Tuesday June 14 2016, @04:43PM
Interesting idea. It wouldn't work that easily because many logged in users have customized their score, visibility, and number of comments per page settings and even ACs can customize a little bit via the drop-down menus, so we'd need potentially thousands of cached versions for each story. I recently tried just using a memory cache of the same-for-all-users db results but didn't see any detectable improvement.
Nah, what it's choking on currently is processing the templates necessary to generate a laid out comment for each of potentially hundreds of comments. With Threaded and your comments per page setting at max you see every comment for the linked story above on the first page, all four hundred plus of them. And it takes over a minute to render. Me, I'm currently thinking it'd be faster to do away with templates for comments and do the layout as hardcoded as possible.
My rights don't end where your fear begins.
(Score: 0) by Anonymous Coward on Tuesday June 14 2016, @09:31PM
That's the kind of thing that could be fixed with smart javascript.
Let the posts be a static file and use javascript to apply the filters to hide/collapse based on the score.
Might even be able to do it without javascript, just really clever CSS.
(Score: 2) by The Mighty Buzzard on Wednesday June 15 2016, @12:53AM
It'd have to be some extremely clever css. Collapsing comments below score N we can do easily through css, and already are doing so on dev, but the numeric comparison has to be done server-side unless we want to use javascript, which is a non-starter. House rule: everything has to run correctly without javascript turned on. Too many of the community block it.
My rights don't end where your fear begins.
(Score: 2) by Username on Tuesday June 14 2016, @10:38PM
Yeah could have one large template and load separate stylesheets for each level of score, comments etc. Offload it to the browser.
(Score: 2) by The Mighty Buzzard on Wednesday June 15 2016, @12:47AM
Gravis and I talked about just that a month or so ago in IRC but there are a few problems that keep it from being possible. There's processing that has to be done to the raw score and either perl has to do it or javascript does. We are moving the collapsed/non-collapsed state out to CSS but the low-hanging fruit that paulej72 and I could find is already gone.
My rights don't end where your fear begins.