4 ms·
Given the various claims set forth in the discussion, one thing that would be very useful would be a map of what's written in what language. From what language
by bborud 3y ago
Given the various claims set forth in the discussion, one thing that would be very useful would be a map of what's written in what language. From what languages are used in Apple's desptop apps, iOS, watchOS apps etc to what is used in those pesky macOS daemons. You know, the one where a new daemon decides to blow up every release and consume enormous amounts of CPU.
One thing that has always puzzled me is the low quality of a lot of Apple software. Here are some things that tend to happen over and over:
- Desktop applications that block the UI thread and present spinning ball of fail
- OS daemons that consume far more CPU than they should and often get stuck in a state where they consume lots of CPU
- Slow downloads and ultra slow "checking for update" type scenarios
It wouldn't hurt Apple to focus on quality for a couple of years. Both to rewrite a lot of software that doesn't quite perform as it should, as well as laying down some plan for long term quality enhancement.
The stuff that is written in C/C++ and possibly Objective-C today should perhaps be written in Rust. Rust is a pain in the ass to program in, but I do think it is worth it for system software just because it affects so many people when stuff fails. And I suspect a lot of Objective-C code could also be replaced with Swift.
- jjtheblunt 3y ago> You know, the one where a new daemon decides to blow up every release and consume enormous amounts of CPU. What are you referring to, for specific example? I haven’t had any of the symptoms you list.
- JimDabell 3y agoNot those exact symptoms, but Apple replaced mDNSResponder with discoveryd then gave up and went back to mDNSResponder because they couldn’t get discoveryd stable: https://mjtsai.com/blog/2015/05/27/mac-os-x-10-10-4-replaces-discoveryd-with-mdnsresponder/ https://mjtsai.com/blog/2015/05/27/mac-os-x-10-10-4-replaces...
- mcculley 3y agocontactsd was burning 100% of a core for years for me until a recent update.
- bborud 3y ago....and as if on cue, contactsd started consuming lots of CPU on my machine. Goddamnit you jinxed me. :)
- jjtheblunt 3y agoIt’s pretty wild, considering that I haven’t had any of those issues and I’m on Apple stuff continually all the way back to next step days. I guess I’ve just had good luck in comparison.
- mcculley 3y agoI am certain that it is because I have a large address book and one or more cards exposed a bug. I expect that people with simpler address books (almost all users) never saw this. I reported it to Apple and never heard anything back, as expected. If you google, you will find others reporting the same misbehavior.
- jjtheblunt 3y agoHave you tried turning off syncing of contacts with Gmail accounts/Outlook/Exchange servers, just as an experiment? Perhaps there's some protocol mismatch between contactsd and external ldap or whatever they use servers. I thought of this not because of a cpu core craziness, but a strange symptom i had for many months. On one of my macs i could see known people only as their phone numbers, and on another mac i saw their names: i had contact syncing settings toggled on/off differently between the two macs, wrt Gmail and Outlook servers (and i didn't realize i'd put any contacts on those servers...thought they were all in MacOS contacts).
- mcculley 3y agoI was not synchronizing with anything but iCloud. Before the recent update that fixed it, I was in the habit of disabling WiFi when on battery so that my laptop would not drain my battery. contactsd definitely was doing something dumb around synchronization. At one point, I backed up my ~8,000 contacts and deleted them all. Everything was fine until I restored them.
- bborud 3y agoThree examples are powerd, bluetoothd, and more recently CalendarAgent. CalendarAgent spending 100% CPU syncing a calendar that has almost no entries is...astonishing. For powerd and bluetoothd I eventually wrote a program to keep an eye on them and terminate them if they use close to 100% CPU for more than a minute or so.
- jjtheblunt 3y agoThanks for the examples. It’s very interesting that it happens to someone that others and I haven’t had that happen to me, but I believe you. It would be really interesting to know, once the issue is fixed, in some future release, what triggered it for some people and not others.
- valty 3y agoI agree that Apple has a lot of low-quality software. I found that ObjC made it easy to write spaghetti code if you don't understand the motivations behind ObjC and its SmallTalk-like OO approach, and if you didn't have good rules to follow, and really think hard about the best way to do things. I feel like too many people came into ObjC trying to just use it like Java or Python. The dynamic-ness of it can quickly get out of control, event handling was verbose and tangled. I feel like ObjC was missing a proper SmallTalk environment to tame it. I think ObjC caused a lot of this bad software. Race conditions, state management bugs, logic bugs, etc. But on the flip-side the compiled nature of it allowed things to be fast when they needed to be. Swift Playground was a good sign of Apple drawing on its SmallTalk roots, but at the same time entirely abandoning the SmallTalk OO approach. I find Swift a bit of a boring language. It's just a new compiled language with some fun and quirky syntax choices. There doesn't seem to be any brave new philosophy or new ideas behind it.
- lapcat 3y ago> I think ObjC caused a lot of this bad software. Race conditions, state management bugs, logic bugs, etc. Apple software quality has declined significantly from the Objective-C era to the Swift era; but that actually has nothing to do with the programming language and everything to do with the forced march yearly release schedule and the lack of caring about quality by current Apple leadership.
- bborud 3y agoI'm not entirely sure. Remember the frequent spinning ball of fail that you'd get from any apple software? Remember how bad iTunes was? And while Finder is still prone to spinning ball of fail - it used to be worse.
- lapcat 3y ago> Remember the frequent spinning ball of fail that you'd get from any apple software? No. > Remember how bad iTunes was? Yes, but I would kill to get iTunes back now, because it was much better than Music app, which is absolute garbage. > Finder is still prone to spinning ball of fail - it used to be worse. I find Finder to be worse now, and slower. I'm not talking about the spinning beachball, I'm talking about normal operations such as sorting folders, copying and moving files, emptying the trash, etc. This is despite the fact that the hardware is faster than ever!
- widdershins 3y agoI don't know that Rust would solve the issues you mentioned. It's great for fixing memory errors, and making it hard to make logical mistakes where you forget to handle a particular case. But it doesn't do much to stop deadlocks, quadratic algorithms, or 'scheduling' type mistakes where a thread gets into an asynchronously reptitive loop.
- steveklabnik 3y agoApple has been using Rust in various places for a few years now, incidentally.
- ninkendo 3y agoPerhaps on the server, deep in their ops orgs, or for some internal tooling, but I don’t think any of the software they ship to devices is rust (yet?) If someone found a rust binary somewhere on a macOS install I’d be super interested.
- steveklabnik 3y agoYeah, the job listings I've seen have been for server side services. I'm not aware of Rust being in macOS. Would be cool though!