Monday, May 27, 2019
Wednesday, May 22, 2019
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;
}
}
{
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”)
Friday, May 17, 2019
GET MEMORY HEAP SIZE ON MOBILE
ANDROID
https://stackoverflow.com/questions/2630158/detect-application-heap-size-in-android/2634738#2634738
IOS
https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html
STACK SIZE IN C#
https://stackoverflow.com/questions/2630158/detect-application-heap-size-in-android/2634738#2634738
IOS
https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html
STACK SIZE IN C#
Today's PCs have a large amount of physical RAM but still, the stack size of C# is only 1 MB for 32-bit processes and 4 MB for 64-bit processes (Stack capacity in C#).
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
Subscribe to:
Posts (Atom)