View profile

📈 ABC - ABBA, Benchmarks, and Count - Not Only Swift Weekly - Issue #12

Peter Friese
Peter Friese
👋🏻 Hello everyone!
It’s Firebase Hackweek: everyone on the Firebase team gets to work on something they don’t usually work on, and at the end of the week, we have an internal presentation to demonstrate what we’ve achieved. Some of these projects are purely internal, but some of them might actually be launched as public features (after receiving some polish, code review, and a proper launch process), so who knows - maybe you will be able to use what @mbleigh and I have been working on this week in the not-too-distant future! It’s something a lot of people have asked us for - that much I can tell you!
If you want to venture a guess, you can always send me an email, or DM me on Twitter (my DMs are open).
I hope you enjoy the articles, videos and libraries as much as I did curating them! As always, don’t forget to let me know if you liked the newsletter (there’s a little yes/no link at the end), and if you did, share it with a friend. If you didn’t like it, why don’t you write me a quick note what you’d like to see improved, and I’ll try to do better next week!
Thanks for reading,
Peter 🔥

John Sundell published a great article this week that demonstrates that it’s indeed useful to pay attention to the runtime complexity of an algorithm. Thankfully, many of Apple’s APIs contain information about the runtime complexity of certain methods, and it’s well worth your time to read them and be aware of the implications.
Using count vs isEmpty to check whether a collection contains any elements | Swift by Sundell
To check your own code and see where where you used count instead of isEmpty, check out this handy tip by @thecraftybrit:
@swiftbysundell @johnsundell Great analysis. To help find code where you used count instead of isEmpty, you can enable the optional ‘empty_count’ rule in SwiftLint.

- empty_count

To your .swiflint.yml file
Speaking of timing, @codeslice just released a great video in which he benchmarked his new M1 MBP (fully specced-out!) against his previous Mac Mini. As always, it’s produced to Adam’s amazing standards, and I was impressed by the dedication he put into making sure the numbers are correct. Definitely check out the video, you might be surprised about some of the results!
M1 Max vs Xcode - Worth Upgrading as an Xcode Developer?
M1 Max vs Xcode - Worth Upgrading as an Xcode Developer?
Of course, I couldn’t resist reaching out to Adam to ask if he could run some additional benchmarks for me, and he agreed - thanks again, Adam! The benchmarks I asked him to run are:
  • Performing a clean build of MakeItSo (my replica of Apple’s Reminders app)
  • Performing an incremental build of the same code
This is especially interesting for those of use who use Firestore, which is known to increase build times quite a bit.
So, thanks to Adam giving up his lunch break, please enjoy the following diagrams which demonstrate how much time you will save by getting yourself a shining new M1 MBP:
Image courtesy @codeslice
Image courtesy @codeslice
Image courtesy @codeslice
Image courtesy @codeslice
It’s quite impressive to see the build times cut in half on an M1-based Mac. The good news for those of us who might not upgrade to a new machine just yet is that the incremental build times aren’t too bad.: 10.5 seconds on a MacMini vs. 5.5 seconds on an M1 Max. Ten seconds are just enough time to take a sip of tea or coffee, and as we all know, it’s important to stay hydrated 💧
Speaking of benchmarks, @justsitandgrin discovered macOS Monterey includes a command line utility for measuring network quality - nice!
TIL: #macOS #Monterey ships with a command-line tool to measure a network quality – `networkQuality`.
I mentioned @mengto last week already, and this week he shared a nice trick to take SVG shapes from Figma and turn them in to SwiftUI Shapes.
Meng To
A trick to turn SVG shapes from Figma to SwiftUI
If you’d like to try if for yourself, here is a link to the tool he used: . My quick experiment with the SVG Tiger looks promising (but also - more than 2400 lines of code…).
No matter if you’re a fan or not - I am pretty sure you know Swedish supergroup ABBA and will have listened to at least a few of their songs. In this episode of Switched on Pop, Nate and Charlie go through just why ABBA became so successful, and why their songs just hit. Definitely worth listening, even if you’re not a fan!
Did you enjoy this issue? Yes No
Peter Friese
Peter Friese @peterfriese

Xcode tips & tricks, Swift, SwiftUI, Combine, Firebase, computing and internet history, and - of course - some fun stuff.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.