promotion
Powerful debugging in Xcode,
no code changes or 3rd party frameworks required.

Introducing timeui

A little while ago I coded a minimal profiling tool for the macOS command line and called it timeui. Last week I pushed the source code online in the hope other people would like it and use it (and eventually contribute some code too). In this post I’ll introduce you quickly to timeui and what it can currently do for you. What is timeui? timeui is a command line tool that profiles an app you provide it and shows duration, apple’s universal logging intervals, CPU usage and memory footprint: …

Posted on

Optimization in Swift, part 4

In Part 3 I wrote about trying to optimize my filter code by using an unsafe API from the standard library. This helped a tiny bit but barely improved the performance of my initial fictional use case (all about the test setup you can find out in Part 1). Updating the Memory Buffer Concurrently Looking at the results of both code variants so far, I got an idea — I could fuse together using concurrency to do the collection filtering and using a buffer in memory so I can update the array storage directly. …

Posted on

Optimization in Swift, part 3

In Part 2 I wrote about trying to optimize a very tight filter function with async/await. This helped when the filter performs some heavy work for each of the collection elements but not with my initial fictional use case (all about the test setup you can find out in Part 1). Taking to the Standard Library Since I already know that I’m not going to keep pushing the async/await variant of the code, I think it’s a good idea to look into the standard library. …

Posted on

Optimization in Swift, part 2

In Part 1 I wrote what this mini-series would be all about. Given the default array filtering is a performance bottleneck for my fictional app, I’m going to explore if I can write code that performs better in my specific use case. In this part, I’m going to rewrite my initial filtering function and use the new async/await Swift concurrency syntax. An async filter function Since TaskGroup still has a performance issue in the current version of Swift, I’ll use a simplified code that uses only top tasks (e. …

Posted on

Optimization in Swift, part 1

This will be yet another exploratory series on my blog — this time around, I want to write a little about optimizing performance in Swift code. This is, of course, an endless topic so what I’m going to do is, similarly to previous posts, focus on a problem and then track my way through working on it. Also, since this might turn into a somewhat longer read, I thought I’d split it into several short parts; so if you are in fact interested to read through you don’t have to put in all the time at once. …

Posted on