Sunday, May 19, 2019

Inline Function

http://blogs.microsoft.co.il/sasha/2012/01/20/aggressive-inlining-in-the-clr-45-jit/

public static int SmallMethod(int i, int j)
{
    if (i > j)
        return i + j;
    else
        return i + 2 * j – 1;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int LargeMethod(int i, int j)
{
    if (i + 14 > j)
    {
        return i + j;
    }
    else if (j * 12 < i)
    {
        return 42 + i – j * 7;
    }
    else
    {
        return i % 14 – j;
    }
}
The code size for these methods is 16 and 34, respectively. Without the AggressiveInlining attribute, the first method is inlined and the second is not inlined. With the AggressiveInlining attribute, the second method is inlined as well.
However, methods that couldn’t be inlined previously because of other criteria are still not inlined. I checked the following, and neither of these methods was inlined:
  • Recursive method
  • Virtual method (even if the static type of the receiver variable is sealed)
  • Method with exception handling (representing a “complicated flowgraph”)

Wednesday, May 15, 2019

Support for Android App Bundle (AAB) in Unity 2018.3 beta

Larger apps and games convert fewer Google Play store visits into installs. This is because users are conscious of using up storage on their device, using up their data plans, and waiting around for downloads to complete on slow connections. Android App Bundle is a new Android app publishing format which makes games smaller on people’s device.


https://blogs.unity3d.com/2018/10/03/support-for-android-app-bundle-aab-in-unity-2018-3-beta/?fbclid=IwAR1t9h8l5CmiZvKshNHOk8HmJYnvC2ADkGa036bbyQiRtgKWd36I-yK45Dc