Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
11–20 of 24 posts
Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#12Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#13Judging from the other commeters who didn't noticed spikes, I think there might be something related to your hardware and software combo that is causing it.
Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#14I just timed it real quick in Edge 134.0.3124.93 and collapsing svara's top level thread hangs the browser and lags my system for 1 minute 36 seconds.
Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#15I have an old system with simple older firefox -- It can collapse the given example without even noticing ... well not perceptible to myself ... I'd call it near instantaneous, also tried repeatedly as well as going though collapsing the rest but was unable to cause a falter. I do though have a deny list of sites that provide / contain scripts that snoop too hard as well as a couple I'm suspected set up as resident i…
Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#16I know, for instance, that Dark Reader seems to affect my CPU usage when mass updating DOM elements like that.
And I suppose it depends on your CPU, if you're running modern browsers on a fifteen year old laptop you're going to see CPU spikes all over the place.
Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#17Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#18This reminds me that one time on one Czech Linux portal when someone posted blog about crocodile infested river, there were several characters and you were supposed to decide who is more or less moral and judge their behavior in the story. The whole thread became so massive that it brought portal down and even today when you open it it loads half a minute.
Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#19The Javascript is surprisingly readable (not minimized, not using any framework). It looks like all the comments are peers according to the DOM structure. When it collapses a comment, it loops through all the following DOM siblings until returning to the same indent level (so all the semantic descendants) and hides them one-by-one. I could see why this could be a bit slow even though it isn't for me. I'm not really a frontend person so I don't know why they might have chosen this structure. One could imagine if the DOM structure were set up such that the comment's descendants were DOM descendants, it wouldn't have to do this at all. It could just use a CSS selector that would hide elements (and thus their descendants also) if their direct parent were collapsed.
Re: Ask HN: Does Collapsing an HN Thread in a Popular story spike your CPU use?
#20I can reproduce this consistently in both Edge and Chrome. I've been assuming that it was a change to how Chromium redraws pages that was introduced a few months ago, but I haven't really looked into it. I just started hitting Next instead of collapsing anything. I just timed it real quick in Edge 134.0.3124.93 and collapsing svara's top level thread hangs the browser and lags my system for 1 minute 36 seconds.