[PATCH] D124715: Use QoS class Utility for ThreadPriority::Low on Mac
David Goldman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 4 11:01:21 PDT 2022
dgoldman added a comment.
In D124715#3490364 <https://reviews.llvm.org/D124715#3490364>, @stefanhaller wrote:
> In D124715#3488447 <https://reviews.llvm.org/D124715#3488447>, @sammccall wrote:
>
>> (How) does this interact with battery vs mains power on laptops?
>> It seems like there's a common scenario where:
>>
>> - the user is on a relatively slow laptop, running off battery
>> - the codebase is large, and indexing is unlikely to finish within an editing session
>>
>> In this case, it seems like only using efficiency cores is what you'd want, and that people are likely to be upset if clangd 15 keeps their performance cores running at all times.
>
> I can only speak for myself here: I'm a laptop user myself, and I work on battery the majority of the day; but I still wouldn't trade indexing speed for saving battery. The clangd index is so essential for my work that I always want it to be available as quickly as possible.
>
>> Reading the docs <https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/PrioritizeWorkAtTheTaskLevel.html> it seems like background is the intended QoS for this type of work ("such as indexing"..."minutes or hours").
>
> How long it takes is only one aspect of it. Other clues from the documentation:
>
> Utility: "typically have a progress bar that is visible to the user. Focuses on providing a balance between responsiveness, performance, and energy efficiency."
> Background: "isn't visible to the user. Focuses on energy efficiency."
>
> The way I read it, Background is intended for tasks that don't make a significant difference to the functionality of the software. An example might be face detection in the Photos app; as long as it is not finished, it only affects a small part of the functionality, the rest of the app is perfectly usable. That's not the case for clangd, the software is pretty much not usable without an index.
See also Argyrios's comment <https://github.com/clangd/clangd/issues/1119#issuecomment-1108843878> - I think the main problem is it competes with Spotlight indexing and disk backups. Maybe we'd want to keep this customizable though e.g. via a clangd flag?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124715/new/
https://reviews.llvm.org/D124715
More information about the cfe-commits
mailing list