4 ms·
Prioritize work at the task level
- ComputerGuru 2y agoI thought this was a life hack recommendations article but it’s about Quality of Service. @dang or @op can we get QoS added to the title?
- jolmg 2y agoI thought the same, but the parenthesized domain should be an adequate hint, to be fair.
- aaronbrethorst 2y agoHere's a link to best practices for multitasking from the same domain: https://developer.apple.com/design/human-interface-guidelines/multitasking#Best-practices https://developer.apple.com/design/human-interface-guideline...
- danudey 2y agoI fell for this one too.
- layer8 2y agoI was thinking that maybe Apple had useful guidelines for how developers can prioritize their work. :)
- antonvs 2y agoI thought that too. I even thought of an explanation, involving tasks that impact multiple projects.
- winwang 2y agoI actually thought you meant that this was about applying QoS algos to real life, before I saw the link lol.
- deleted 2y ago[deleted]
- Etheryte 2y agoIt's good practice to not editorialize the title when making a submission. You could misread many titles to mean something else, it's sort of a hidden assumption that you should read the article before commenting on it.
- layer8 2y agoIt doesn’t seem to me like the GP commented before looking at the article. I think it’s justified to clarify a title that’s prone to be misleading. That’s different from editorializing, which is inserting one’s own opinion or agenda in the title.
- lupire 2y agoWhy would a dev use this? I want my app to perform as high as possible, regardless of other apps (published by other companies) on the system. This should be a user-controlled feature, with tasks identified and labeled by the OS.
- petercooper 2y agoUser experience? Developers do profiling, optimization, and the like all the time to make their apps smoother, faster, and less intensive on the system. If every app did this properly, the benefit is that when you really need absolute highest priority for a task, you might actually stand a chance of getting it if every other app isn't doing exactly the same thing. But tragedy of the commons and all that..
- lopkeny12ko 2y agoThat's not how this works. Fundamentally, any machine has finite resources and it is the kernel's responsibility to sort and prioritize more work than there are available resources to complete it. If you make no differentiation in priority of your app's tasks by saying "everything is important," then the kernel will treat truly important work as weighted equally as unimportant work. You can see how this is counterproductive, both to your app, the user of your app, and other apps running on the system written other developers.
- rossjudson 2y agoCritically important is a metric that the doc notes: Apps should spend 90% of their time when they are not responding to UI-initiated tasks at "Utility" or less...and then there's a mechanism devs can use to actually see where their apps sit. Setting a standard is helpful, but providing well-engineered mechanisms and monitoring to accelerate compliance is critical to achieving the intended overall effects (let's say, battery life).
- Thorrez 2y agoIf your app drains all the battery, or makes the phone laggy, users might avoid your app.
- eunoia 2y agoAdditional reading about how Swift Structured Concurrency (Task API) utilizes and propagates QoS is in the proposal doc. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0304-structured-concurrency.md https://github.com/swiftlang/swift-evolution/blob/main/propo...
- jmmv 2y agoA number of years ago, I was working on the port of Bazel to macOS. One of the issues we faced internally at Google was that some of our users reported that Bazel builds randomly killed their Internet connection and that they performed poorly. There was a lot of FUD around the topic, with some engineers blanket-claiming that "well, macOS is bad at threads, so there's that". I didn't buy that explanation because I had seen macOS under serious load in other occasions and none of this nonsense happened in them. And then, almost by chance, I stumbled upon this QoS system, did a few spot-checks, and found that the VPN daemon was misconfigured to run at a low class. Consequently, Bazel starved the VPN for those users and made everything misbehave. Adjusting that one parameter fixed everything. If you are curious, I ended up writing some more on this here: https://jmmv.dev/2019/03/macos-threads-qos-and-bazel.html https://jmmv.dev/2019/03/macos-threads-qos-and-bazel.html
- crabique 2y agoHow would one go about changing QoS for the system daemons and would it require disabling SIP? I don't see anything relevant in launchctl's man or launchd documentation, really interested to try it on the system VPN service.
- jmmv 2y agoIn that specific case, it was our own installation of a VPN client and a custom definition of its launchd configuration. I don’t remember the exact details anymore. I’d expect the system-provided services to be correctly configured by Apple in this regard.
- deleted 2y ago[deleted]