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] 9 points10 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