Tips for post creation

This is the 1st post of “Everything I learned from blogging with Hugo” series I started blogging in Dec 2021. It’s been a wonderful journey. Has enabled me to gather my thoughts in a far more structured way. The series is based on my setup of Hugo - Netlify - GitHub. I’ll shared my knowledge in terms of Hugo knowledge, how to write a blog post and more. If anyone is interested in the Netlify setup, see Hugo Quick Start then Netlify - Hugo setup....

October 1, 2023 · 10 min

Tree Basics and some Swift helpers for leetcode

I do leetcoding every once a while, but keep forgetting some tree basics. This post here it to help with that. Types of Tree Trees can have multiple children. Or on the special case of binary trees have only two. A binary tree is still different from a binary search tree (BST) where things follow a certain order. Binary search tree For a Binary tree to be a BST, it has to follow the following rules:...

September 11, 2023 · 8 min

How Can I Inspect the Size Impact of Symbols in an App Binary: A Practical Guide for Apple Developers

In the previous posts we talked about Build Pipeline, Jargon, Static Linker vs Dynamic Linker. In this post we’ll benefit from the knowledge gained about the app wrapper’s folder structure and the placement of all the different binaries (frameworks and main app’s executable) to know where to look for. New in this post is learning how to use the nm command to inspect and count the number of symbols of each binary....

August 11, 2023 · 9 min

Optimizing Binaries - How Does the Linker Help Reduce App Size? What are the different types of linking - Part Two

In the previous post we talked about how the linker’s selective loading helps solve the bloat issue. But there are some other limitations to static linking. Because of those limitations software engineers created Dynamic libraries and the Dynamic Linker. In this post we’ll go through some of those limitations and discuss the trade-offs between the two ways of linking and their sizing impact. Inspired by Link fast: Improve build and launch times - 15:47:...

July 4, 2023 · 9 min

Optimizing Binaries - How Does the Linker Help Reduce App Size? What are the different types of linking - Part One

In the previous post we talked about a problem with the linker: Linking a single function from a library could link to the entire library. This creates a lot of bloat. As a result some enhancements were made to linker. The enhancement was to be selective and only load symbols that you need. Inspired by Link fast: Improve build and launch times - 4:15: Selective Loading In a nutshell if you have the following source code written in C:...

July 4, 2023 · 6 min

Optimizing Binaries - Build Pipeline Jargon

To understand this post, I highly recommend everyone to watch the WWDC 2022 - Link fast: Improve build and launch times and WWDC 2018 - Behind the Scenes of the Xcode Build Process. They’re of the best talks I’ve ever seen. This post covers some of the jargon and how it all comes together. And even though I love making puzzles, I’ll justify why I picked it as my cover....

May 31, 2023 · 12 min

Optimizing Binaries - High Level Xcode Build Pipeline

This the first post of a series I’m doing on how to optimize your app’s binaries. The post is more of a high level intro. Depending on the action (build, run, test, profile, analyze, archive) of your scheme, the process will have all or some of the following steps: Dependency analysis What happens when you press build? So the first step is for the build system to take the build description, your Xcode project file....

May 3, 2023 · 4 min
Difference between an app bundle and a binary

Whats the Difference Between an App (bundle) and a Binary

A binary is the linked product of all your source code. It’s executable. You can run commands against it. An app, is merely a wrapper/directory, which includes that binary and other things. How do you create a binary? First it’s important to understand what a binary is. You’ve used them every day in the terminal. Examples: ls, cp, mkdir. You pass certain parameters to them. They don’t have any file extension....

March 28, 2023 · 3 min

The power and expressiveness of Swift ranges

Ranges in swift are super simple to create. Yet they come in various forms. let r1 = 1...3 let r2 = 1..<3 let r3 = ...3 let r4 = 3... let r5 = ..<3 They all have range like characteristics, but have slightly different traits. It’s because they’re actually different types. Different Range Types let r1 = 1...3 // ClosedRange<Int> let r2 = 1..<3 // Range<Int> let r3 = ...3 // PartialRangeThrough<Int> let r4 = 3....

March 10, 2023 · 6 min

How cp case-insensitivity can cause chaos!

Been doing Advent of Code in the last couple of days. I completed Day 6. I have been doing it from an Xcode project. However I was thinking it would be nice if I could do it from command line. So I started to do some code clean up. First I started with renaming the folder from AOC to aoc. I did: cp -r AOC aoc I saw a new aoc directory created....

December 6, 2022 · 4 min