Open3
C# 最適化関数呼び出し調査編(IL2CPP)

これの調査をUnity IL2CPPでも行った

static fieldのアクセスが遅いので、分けた
Unity6000.0.38f1
Faster runtime
Index | Test Name | Min | Max | Median | Average |
---|---|---|---|---|---|
0 | CallDelegatePerformanceTest | 0.8395 | 1.0745 | 0.97555 | 0.968716 |
1 | CallDelegateStaticPerformanceTest | 1.1995 | 1.5848 | 1.38425 | 1.383662 |
2 | CallDirectPerformanceTest | 0.2959 | 0.4296 | 0.30215 | 0.311851 |
3 | CallFunctionPointerPerformanceTest | 0.7924 | 0.9817 | 0.8002 | 0.807913 |
4 | CallFunctionPointerStaticPerformanceTest | 1.3264 | 1.5366 | 1.3909 | 1.412462 |
5 | CallInterfacePerformanceTest | 1.7773 | 2.3049 | 1.78975 | 1.804706 |
6 | CallInterfaceStaticPerformanceTest | 1.9786 | 2.3464 | 2.0194 | 2.045405 |
7 | CallStaticMethodDelegatePerformanceTest | 1.3746 | 1.8057 | 1.481 | 1.509527 |
8 | CallStaticMethodDelegateStaticPerformanceTest | 2.1658 | 2.6209 | 2.2654 | 2.293088 |
Faster (smaller)build
Index | Test Name | Min | Max | Median | Average |
---|---|---|---|---|---|
0 | CallDelegatePerformanceTest | 2.3094 | 2.6516 | 2.40795 | 2.429216 |
1 | CallDelegateStaticPerformanceTest | 2.6615 | 4.6817 | 2.8748 | 2.927011 |
2 | CallDirectPerformanceTest | 0.2957 | 0.454 | 0.29955 | 0.306058 |
3 | CallFunctionPointerPerformanceTest | 0.7871 | 0.8897 | 0.79745 | 0.799968 |
4 | CallFunctionPointerStaticPerformanceTest | 1.1701 | 1.589 | 1.3845 | 1.37543 |
5 | CallInterfacePerformanceTest | 1.7637 | 2.0102 | 1.78995 | 1.808698 |
6 | CallInterfaceStaticPerformanceTest | 1.9717 | 2.4935 | 2.0007 | 2.03099 |
7 | CallStaticMethodDelegatePerformanceTest | 2.4055 | 3.0456 | 2.5732 | 2.587155 |
8 | CallStaticMethodDelegateStaticPerformanceTest | 3.0094 | 3.5213 | 3.1798 | 3.206749 |

static fieldのアクセスが遅すぎる。
というかおそらく初期化チェックが遅い。