3 ms·
> Chrome measures jank every 30 seconds, so Jank in 1% of samples for a given user means jank once every 50 minutes Is that actually true? Doesn't this just me
by vlovich123 6y ago
> Chrome measures jank every 30 seconds, so Jank in 1% of samples for a given user means jank once every 50 minutes
Is that actually true? Doesn't this just mean that once every 50 minutes the system has been janky for >= 60s? Anything less & you're below the Nyquist frequency & are unlikely to be actually sampling it, no? My knowledge of signal analysis is just what I recall from some intro university classes so there could be more involved here in this claim so happy to learn if I'm misremembering (+ it might be made more complicated because their also sampling across a population of users).
(Speaking as somehow who regularly has to shut down Chrome because it's making my entire machine janky).
- infogulch 6y agoI think you're assuming too much about what they mean by 'measure'. My guess is that they measure all jank regardless of duration, and record in frequency buckets that are 30s wide. But it's not exactly clear.
- vlovich123 6y ago30s frequency buckets wouldn't be phrased as "every 30s" though, no?
- infogulch 6y agoI don't know how they would phrase it, but the whole sentence seems disjointed like it's been through too many editing passes and lost meaning.
- londons_explore 6y ago> Speaking as somehow who regularly has to shut down Chrome because it's making my entire machine janky You either need more RAM, or a browser that uses less RAM...
- vlovich123 6y agoCurrently I have 32GB & used a machine with 96GB. How much RAM do browsers need? FWIW Firefox doesn't do too much better.
- londons_explore 6y agoDo you have a machine with slow storage (hard disk or early SSD)? Chromes HTTP cache does a lot of tiny reads and can easily make the whole system slow, especially when the profile is gigabytes or more. Clearing the cache, or even the entire Chrome profile will fix it if its the case.
- vlovich123 6y agoTraditionally always an SSD & more recently (on the 32gb machine) NVME. I/O is certainly a good hypothesis. Regardless of the subresource, I think the fault actually lays with the kernel. I don't care how many subprocesses are started - the totality should be grouped under a jail that is fairly queued with all other work on CPU & I/O unless I explicitly raise that jails limits (heck, maybe even RAM - swap out Chrome more quickly if it's hogging up all the RAM).
- londons_explore 6y agoChrome has a lot of processes, but only 1 or 2 processes do all the disk and network IO, so I don't think that particular hypothesis holds up. What you say probably is an issue with CPU scheduling though.
- vlovich123 6y agoYeah. I was thinking more that kernels historically have not been able to achieve good I/O queuing for user-facing operation (some of which was probably because the hardware interfaces weren’t good enough. Maybe that’s been since resolved. I do think it causes issues with CPU scheduling but it could be any number of other issues. I don’t think kernel developers are looking at improving the overall perf of the system with a large number of chrome tabs.
- vlovich123 6y agoNow that I've finished reading, I'm curious why the Chrome team didn't optimize GetLinkedFonts since it's the obvious culprit to my eye. Querying the registry is slow. Really slow. . The Chrome code appears to always read it on a missing value. If you have a missing value in your already populated cache, then every miss is going to reach out to the infrequently changing registry. It makes far more sense to only invalidate your in-process cache when the registry actually changes
- londons_explore 6y agoIndeed it would seem a trivial change to cache failed lookups here[1] [1]: https://source.chromium.org/chromium/chromium/src/+/master:ui/gfx/font_fallback_win.cc;l=151;drc=3b4736cba1d80c07fe3633694f250d20e9d9a64d;bpv=1;bpt=1?q=GetLinkedFonts https://source.chromium.org/chromium/chromium/src/+/master:u...
- vlovich123 6y agoYup. Looked at the source first to double-check there wasn't a legitimate reason for the registry read. EDIT: Filed the suggestion upstream: https://bugs.chromium.org/p/chromium/issues/detail?id=1202146 https://bugs.chromium.org/p/chromium/issues/detail?id=120214...
- masklinn 6y ago> Now that I've finished reading, I'm curious why the Chrome team didn't optimize GetLinkedFonts since it's the obvious culprit to my eye. That's the point of the article: `GetLinkedFonts` is the "obvious culprit", but it's the fallback to the fallback, it should not be getting called in the first place. It doesn't really matter that it's slow because it should almost never be called. And then, I assume they fixed (or will fix) the cache so that it'd cache failures, so GetLinkedFonts would only be called once per failure instead of being called over and over again, only for failure (as successes would get cached after the first one).
- vlovich123 6y agoAs you can see from another comment, they’re being in efficient in the “uncommon” case and reading the registry even when there’s no changes. How often is “not often”? The 1% case they’re trying to tackle. It’s ~1-2 weeks (maybe more) for one engineer to watch the registry and either they didn’t think of that or consider it not yet warranted for ROI (or didn’t think to do a registry watcher).
- londons_explore 6y agoI think they mean "we have code that sets a flag whenever the UI blocks for more than 100 milliseconds. We clear that flag every 30 seconds. We see it set 1% of the times that we clear it."
- vlovich123 6y agoThat would work but wouldn't let you say that jank happens "once every 50 minutes" because you don't actually know how many times that happened. Also, this article isn't talking about UI blockage. This is talking about the time delta between user input & the result hitting the eyeball, presumably even across any asynchronous threads/IPC.
- bentcorner 6y agoI think the phrasing they used ("Let’s talk about 1%. 1% is quite large in practice. The core metric we use is “jank” which is a noticeable delay between when the user gives input and when software reacts to it. Chrome measures jank every 30 seconds, so Jank in 1% of samples for a given user means jank once every 50 minutes.") was just to give an example of what 1% meant in practice. > Also, this article isn't talking about UI blockage. This is talking about the time delta between user input & the result hitting the eyeball, presumably even across any asynchronous threads/IPC. Aren't those the same things?
- vlovich123 6y agoThat would be a pretty weird example to give I think if the article is solely focusing about a specific bank issue. I think it’s more that “at chrome scale, 1% is a lot, especially when you’re talking about number of users”. > Aren’t those the same things? Depends how you define it. Typically I think of “UI blockage” interpreted as “main thread doing CPU work or blocked on something and not processing events”. That’s a subset of the problems described (and maybe not even a perfect subset since you may have some kinds of UI blockage that’s not directly tracked to a user action). A user action might cause a repaint of the cursor/text. That repaint actually gets to the user through the compositor which is an external process (for security reasons). That’s all asynchronous and means you have to actually plumb through all your time stamps and metadata about the source event in all dependent work in a meaningful enough way to come up with an answer.