Archive for May 31, 2021

Monday, May 31, 2021 [Tweets] [Favorites]

The Difficulty of Accessing Old iMessages

Spencer Dailey (via Hacker News, Reddit):

Many iPhone owners have iMessages from years ago that they can’t access. For example, my wife and I simply want to read the first few messages that we exchanged in 2017, but we can’t.

[…]

The cumbersome way Apple lets you (theoretically) access old messages is to “scroll to the top” of your conversation, but it’s extremely time consuming and doesn’t work in practice. Yesterday I tried to scroll to the “top” of my iMessages that were from and to my wife. After just a few minutes, my computer with 16GB of RAM started “beach balling” and the app froze before I could even get to messages from 6 months ago. Meanwhile, my wife tried to access our earliest messages on her iPhone 8 Plus and it was even sadder: after over 45 minutes of scrolling, she got within a year of the conversation’s beginning and then the iMessages app crashed on her.

How Uber Deals With Large iOS App Size

Milind Chabbi, Jin Lin, and Raj Barik (via Hacker News):

In the following article we will describe how we reduced the code size of Uber’s iOS Rider app by 23% using advanced compiler technologies. The ideas discussed herein also translated to 17% and 19% code size savings in the Uber Driver and Uber Eats iOS apps, respectively.

[…]

High-level language and runtime features related to reference counting and memory allocation are common causes of the most frequently repeated patterns.

[…]

Generic function instantiations and closures specialized at their call sites result in highly similar, long sequences of machine instructions.

[…]

Listing 7 above shows a common idiom recommended by Swift to use the try expressions to deserialize JSON data and assign to properties of a class. In this example, the class MyClass contains 118 properties, which are initialized from a JSON object. The initialization happens via try expressions, which throw Error if the property is not found in the incoming JSON object. If any one of the try expressions fails, all the previously created properties have to be released. When this code is lowered into LLVM IR and then into the machine code, it leads into N blocks of codes where the Nth block and N-1th bock have N-1 same instructions, N-1th and N-2th block have N-2 same instructions and so on — which is a O(N2) replicated code.

They’re contributing the work back to LLVM.

Previously: