android has the concept of baseline profiles that ...
# compose-ios
c
android has the concept of baseline profiles that can really help compose perf on android. Does compose ios need something similar or no because it's "native" code?
j
It's... complicated Baseline profiles work around the cold startup problem that interpreting, JIT-ing, and AOT-ing VMs have. Namely, they indicate the important code paths to be AOT-compiled eagerly upon install rather than after the code has warmed up and reached some threshold of hotness. Now, you're right that native code has no equivalent because, well, it's already native. However, there are still opportunities to indicate to tooling which run at compile-time which functions are important. Usually this involves using tools like LTO (link-time optimization) and PGO (profile-guided optimization) which are very similar in their goal.
👍 1
❤️ 2
👍🏾 1
thank you color 1
Someone would have to write explicit support for using baseline profiles, a very Android-specific format, as the input for the LTO/PGO native tools. And who knows if it even would be possible.
🤔 1
Something that both Android and iOS also benefit from, but again use completely different tooling, is laying out the code in the binary so that the most-used functions (and types) are earlier in the file. And rarely-used things appear later. This basically ensures that the code which is loaded into memory is all very close together (meaning fewer pages need loaded, and increasing the chances that the code you need is already available).
👍 1
On native that code layout thingy is called BOLT. I have no idea if it's an acronym or not.
👍 1
❤️ 1
👍🏻 1