Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Class] Cache the IntPtr constructors in a dictionary.
Using reflection to find these constructors is computation-intensitive, so cache the results. Numbers ======= Test case: rolfbjarne/TestApp@004283d Fix 1 refers to PR xamarin#5009. Fix 2 refers to PR #? Fix 3 is this fix. iPad Air 2 ---------- | Configuration | Before | After fix 1 | After fix 2 | After fix 3 | Improvement from fix 2 to fix 3 | Cumulative improvement | | ------------------- | ------ | ----------: | -----------: | -----------: | ------------------------------: | ---------------------: | | Release (link all) | 477 ms | 481 ms | 224 ms | 172 ms | 52 ms (23%) | 305 ms (64%) | | Release (dont link) | 738 ms | 656 ms | 377 ms | 201 ms | 176 ms (47%) | 537 ms (73%) | iPhone X -------- | Configuration | Before | After fix 1 | After fix 2 | After fix 3 | Improvement from fix 2 to fix 3 | Cumulative improvement | | ------------------- | ------ | ----------: | -----------: | -----------: | ------------------------------: | ---------------------: | | Release (link all) | 98 ms | 99 ms | 42 ms | 31 ms | 11 ms (26%) | 67 ms (68%) | | Release (dont link) | 197 ms | 153 ms | 91 ms | 43 ms | 48 ms (53%) | 154 ms (78%) | When linking all assemblies, the type map has 24 entries, and when not linking at all it has 2993 entries. This is part 3 (the last) of multiple fixes for xamarin#4936.
- Loading branch information