
IOS and macOS Performance Tuning
by Marcel Weiher · first published 2017
10mentions
2recommended by
4HN commenters
2017–2023first – last mentioned
50% recommend50% neutral
Affiliate links. As an Amazon Associate I earn from qualifying purchases.
…that I can roll my own framework. Why? Because I’ve tried to actually think about my underlying data structure instead of defaulting to convention but reflex. The best example? Marcel Weiher Ch 13 in “iOS and MacOS Performance Tuning” explains how to improve lookups in a public transport app by 1000x. What more? The description of the the data (the code) and the the application (the intended use) are probably way better because thinking…
on “Ask HN: What change in your programming technique has been most transformative?” ↗Ha ha. In fact, you can get C-level performance with Smalltalk levels of encapsulation and dynamicism if you pay just a little attention. See iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift: https://www.amazon.com/gp/product/0321842847/ref=as_li_tl?ie...
on “Objective-S: architecture-oriented language based on Smalltalk and Objective-C” ↗…yet we actually think it's OK that programs have problems when their data-sets increase to over a hundred small entries (notes/tasks/etc.). Anyway, I write a lot more about this in my upcoming book: "iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift"[2] [1] http://sbel.wisc.edu/Courses/ME964/Literature/knuthProgrammi... [2] https://www.amazon.com/iOS-macOS-Performance-Tuning-Objectiv...
on “The Fallacy of Premature Optimization (2009)” ↗…Swift is mostly equivalent to Java with a few outliers both for/against Swift. Rust outperforms Swift fairly consistently and sometimes quite considerably. Of course, real apps may be different. The book iOS and macOS Performance Tuning ( https://www.amazon.com/iOS-macOS-Performance-Tuning-Objectiv... ) has pretty damning benchmarks against Swift versus Objective-C even without using any tricky optimizations (not what you originally…
While this is what a lot of people believe, it happens to not be true. For more details, see iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift, Addison-Wesley https://www.amazon.com/iOS-macOS-Performance-Tuning-Objectiv... If you don't want to read a book, here is an example as a series of blog posts:…
on “Apple Announces Full Swift Rewrite of the Foundation Framework” ↗Yes. For example, I wrote "iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift"[1][2] using LaTeX, and I think it came out rather well (Pearson has some pretty amazing LaTeX compositors that took my rough ramblings and turned them into…
on “Designing a Business Card in LaTeX” ↗…NSJSONSerialization, which again isn't exactly a very efficient parsing model (think XML DOM parser). https://github.com/bignerdranch/Freddy/wiki/JSONParser I do a more in-depth analysis in my book, "iOS and macOS Performance Tuning" https://www.amazon.com/gp/product/0321842847/ref=as_li_tl?ie... EDIT: I forgot the link to Freddy
on “Pushing Swift to the Server” ↗…either useless or downright counterproductive. Why should it be different for other aspects of code? Again, needing to form hypotheses is obviously crucial (I also talk about this in my performance book, iOS and macOS Performance Tuning [1]), I've also seen a lot of waste in just gathering reams of data without knowing what you're looking for. That's why I wrote experimentalist, not "data gatherer". An experiment requires a hypothesis.…
on “Code is not literature (2014)” ↗…to a view with drawRect:: and carefully computing and honouring the damage-rect. It went from using 100% CPU for 2-6 fps to 2% CPU at 60fps. (discussed in more detail with other examples in my book: iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift, https://www.amazon.com/gp/product/0321842847/ref=as_li_tl?ie...) Third, if your text does change, you have to redraw everything from scratch anyway. Fourth,…
on “React as a UI Runtime” ↗…however, it strikes the ear as awkward sounding. I wouldn't say there's anything "wrong" about it. It's a matter of taste. It's a bit of a pet peeve for some of us. I bought a book a couple of years ago: iOS and macOS Performance Tuning. I took note that the author had not used the word "performant" even once in the book's 400 pages. Maybe I'm a snob, but it made the author seem the more credible to me.
on “Nonnative English speakers share their gripes about speaking English” ↗