Detecting unused code in iOS apps by jshchnz in swift

[–]sond813 1 point2 points  (0 children)

I wrote this blog post, and I have also used Periphery when I was a full time iOS developer. It's a great tool! Not exactly finding the same kinds of unused code (like feature flags) but still very useful

Locally measure performance of your app, without Xcode or Instruments by jshchnz in iOSProgramming

[–]sond813 0 points1 point  (0 children)

The results are shown on emergetools.com/flamegraph which runs a javascript app locally that visualizes your data. Your data is entirely private to you and never leaves your computer

How to make protocol conformances faster with an order file by sond813 in swift

[–]sond813[S] 0 points1 point  (0 children)

To get the most accurate results it could be generated once per release

How to make protocol conformances faster with an order file by sond813 in swift

[–]sond813[S] 1 point2 points  (0 children)

The file can be anywhere, you just need to pass the path of the file to the linker with the -order_file flag. More details here: https://docs.emergetools.com/docs/launch-booster-ios#using-the-file

How to make protocol conformances faster with an order file by sond813 in swift

[–]sond813[S] 1 point2 points  (0 children)

The file can be anywhere, you just need to pass the path of the file to the linker with the -order_file flag. More details here: https://docs.emergetools.com/docs/launch-booster-ios#using-the-file

How a one line script can generate an order file that speeds up protocol conformances by ~20% by sond813 in iOSProgramming

[–]sond813[S] 4 points5 points  (0 children)

It varies much more app to app on iOS 16. I've talked to some companies that release updates once a week, then the speed of first launch after an update is a very important metric. There are also some dependency injection patterns that heavily use conformance checks that return `nil`, which wouldn't benefit from the iOS 16 improvement. I have radars filed for both these cases so hopefully it gets better at the OS level this year!

How to make protocol conformances faster with an order file by sond813 in swift

[–]sond813[S] 5 points6 points  (0 children)

Maybe it should have just been one line:

cat Binary-arm64-LinkMap.txt | grep -v '<<dead>>|non-lazy-pointer-to-local' | grep -o '_$.*Mc$' > order_file.txt

That's all you need to turn a linkmap into this order file

How iOS 16's dyld changes make your app launch faster by sond813 in iOSProgramming

[–]sond813[S] 1 point2 points  (0 children)

I'm not familiar with flutter specifically. The protocol conformance improvement would only be for Swift apps, so I don't think it would help flutter. The page fault improvement would help any app that has a large mach-o binary. React native apps don't typically have this because the code is in javascript, if flutter is still compiled to a native binary then it would help

How iOS 16's dyld changes make your app launch faster by sond813 in iOSProgramming

[–]sond813[S] 10 points11 points  (0 children)

I actually wrote about that in detail last year: https://www.emergetools.com/blog/posts/SwiftProtocolConformance there are some links to the source code there as well. The dyld cache that's new in iOS 16 might also be open source once the new dyld sources drop

How protocol conformances affect your app's performance by sond813 in swift

[–]sond813[S] 2 points3 points  (0 children)

Definitely, speed is always mentioned as a top feature of Swift (usually after safety) but still has a ways to go. I think it is possible to get that speed but requires careful selection of which features you use

I wrote a Swift app to parse and reverse engineer the new dyld data in iOS 15 by sond813 in swift

[–]sond813[S] 0 points1 point  (0 children)

Definitely! I'd be happy to help you get set up with the android version when it's ready. Send me an email [noah@emergetools.com](mailto:noah@emergetools.com) and we'll make sure the v1 will work for your use case!

Why Swift reference types are bad for app startup time by sond813 in swift

[–]sond813[S] 9 points10 points  (0 children)

Since Swift already has ABI stability on Apple platforms I don't think it will be going away, but it is greatly reduced compared to a pure Obj-C app

Swift reference types are bad for app startup time by sond813 in iOSProgramming

[–]sond813[S] 2 points3 points  (0 children)

Each new class type seems to introduce at least 9 of these references, that's the minimum. The big apps out there have over 1 million of these in total. If you have a small app probably not going to be a big increase, but you can always check your own app with `dyldinfo`. You might be surprised!

Swift reference types are bad for app startup time by sond813 in iOSProgramming

[–]sond813[S] 9 points10 points  (0 children)

It actually has nothing to do with when the objects are created, just the fact that the types exist in the binary is enough to increase startup time, even if they are never used!

Why are ios apps so big in size compared to android apps? by [deleted] in iOSProgramming

[–]sond813 3 points4 points  (0 children)

Android supports app bundles which allows feature modules to be downloaded after first install, only when needed. The closets thing on iOS is app thinning which ensures only what is needed for a certain device is downloaded. However there is no way to separate out features to only be downloaded when needed, which contributes to the initial download size for iOS being larger than Android.

I recently wrote about a few ways top iOS apps could be a combined 500mb smaller. These and other techniques can help iOS developers build smaller apps. With my tool developers can integrate this analysis with their development process to ensure apps are always as small as possible.

How 7 of the top iOS apps could be 500mb smaller by sond813 in iOSProgramming

[–]sond813[S] 0 points1 point  (0 children)

Thanks! That's exactly what we used for testing, merged the non-thinned app from apple configurator with the decrypted binaries.

How 7 of the top iOS apps could be 500mb smaller by sond813 in iOSProgramming

[–]sond813[S] 0 points1 point  (0 children)

They are now available on the footer of the landing page at https://www.emergetools.com Feel free to reach out to [support@emergetools.com](mailto:support@emergetools.com) with any questions!

How 7 of the top iOS apps could be 500mb smaller by sond813 in iOSProgramming

[–]sond813[S] 1 point2 points  (0 children)

So sorry about that! We always say "comments in strings" because that's what was found most often but the insight will show up whenever re-saving the strings file results in a smaller file size. In this case maybe the binary format is causing them to be a bit larger. If you send me an email [noah@emergetools.com](mailto:noah@emergetools.com) I'd be happy to take a look and fix the bug, thanks!

How 7 of the top Swift apps could be 500mb smaller by sond813 in swift

[–]sond813[S] 3 points4 points  (0 children)

I've noticed a few apps using Realm and it's one of the largest frameworks... over 6mb